Summary of the invention
The technical problem that the present invention mainly solves is to provide a kind of charging indicator light control circuit, charging indicator light control method and device, charging device, can solve the problem after terminal plugs charger, charging indicator light being correctly lit.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is:
A kind of charging indicator light control circuit, comprising:
First reference voltage input terminal, the first reference voltage input terminal is used for providing charging voltage;
Charging indicator light, the first end of charging indicator light connects the first reference voltage;
First metal-oxide-semiconductor, the drain electrode of the first metal-oxide-semiconductor connects the first reference voltage input terminal, source ground;
GPIO pin end, GPIO pin end connects the grid of the first metal-oxide-semiconductor;
Second reference voltage input terminal VDD, second reference voltage input terminal VDD is connected between the grid of GPIO pin end and the first metal-oxide-semiconductor, and the requirement that the second reference voltage input terminal VDD is used for lighting according to described charging indicator light or extinguish drags down or draw high the outputs level signals of GPIO pin; Wherein, GPIO pin end acquiescence output low level, the second reference voltage input terminal VDD gives tacit consent to voltage supply, and the low level that GPIO pin end acquiescence exports drawn high, charging indicator light LED is in OFF state; When the charger energising of terminal, charging indicator light LED can not be lit at once; Described second reference voltage input terminal VDD not voltage supply when detecting the ID of battery and the temperature of battery and determine that battery is in charged state, the outputs level signals dragging down GPIO pin makes charging indicator light light; Recover voltage supply when determining that battery charging is complete or temperature is too high and not being in charged state, the outputs level signals drawing high GPIO pin makes charging indicator light extinguish;
Second metal-oxide-semiconductor, the drain electrode of described second metal-oxide-semiconductor connects the second end of charging indicator light, and the grid of described second metal-oxide-semiconductor is connected between the drain electrode of described first reference voltage input terminal and described first metal-oxide-semiconductor;
First voltage providing end, described first voltage providing end connects the source electrode of described first metal-oxide-semiconductor, and the voltage that described first voltage providing end provides is less than the input voltage of described first reference voltage input terminal;
Second voltage providing end, described second voltage providing end connects the source electrode of described second metal-oxide-semiconductor, and the voltage that described second voltage providing end provides is less than the input voltage of described second reference voltage input terminal VDD;
Described charging indicator light control circuit also comprises the 3rd resistance, and one end of described 3rd resistance connects the second reference voltage, and the other end is connected between described GPIO pin and described first metal-oxide-semiconductor.
Further, charging indicator light control circuit also comprises the first resistance, and one end of the first resistance connects the first reference voltage, and the other end connects the drain electrode of the first metal-oxide-semiconductor.
Further, charging indicator light control circuit also comprises the second resistance, and one end of the second resistance connects the second end of charging indicator light, and the other end connects the drain electrode of the second metal-oxide-semiconductor.
Further, the source electrode of the first metal-oxide-semiconductor can also connect the first voltage providing end, and the input voltage of the first voltage providing end is less than the input voltage of the first reference voltage input terminal.
Further, the source electrode of the second metal-oxide-semiconductor can also connect the second voltage providing end, and the input voltage of the second voltage providing end is less than the input voltage of the second reference voltage input terminal VDD.
For solving the problems of the technologies described above, another technical solution used in the present invention is:
A kind of charging indicator light control method, comprising:
GPIO pin end acquiescence output low level, the second reference voltage input terminal VDD gives tacit consent to voltage supply, and the low level that GPIO pin end acquiescence exports drawn high, charging indicator light LED is in OFF state; When the charger energising of terminal, charging indicator light LED can not be lit at once;
Receive the first status signal that battery charger exports, this first status signal shows detect the ID of battery and the temperature of battery and determine that battery is in charged state;
Export the first control signal to charging indicator light control circuit, control the second reference voltage input terminal VDD not voltage supply, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light;
Also comprise after charging indicator light control circuit exports the step of the first control signal:
Receive the second status signal that battery charger exports, the second status signal shows that battery charging is complete or temperature is too high and is in non-charged state;
Export the second control signal to charging indicator light control circuit, make it to export high level with the voltage drawing high GPIO pin end, be in OFF state to make charging indicator light;
Described charging indicator light control circuit also comprises the 3rd resistance, and one end of described 3rd resistance connects the second reference voltage, and the other end is connected between described GPIO pin and described first metal-oxide-semiconductor.
For solving the problems of the technologies described above, another technical scheme that the present invention adopts is:
A kind of charging indicator light control device, comprising:
Receiver module, for receiving the first status signal that battery charger exports, this first status signal shows detect the ID of battery and the temperature of battery and determine that battery is in charged state; Receiver module is also for receiving the second status signal that battery charger exports, and the second status signal shows that battery charging is complete or temperature is too high and is in non-charged state;
First control signal output module, for when receiver module receives the first status signal, the first control signal is exported to charging indicator light control circuit, control the second reference voltage input terminal VDD not voltage supply, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light;
Device also comprises:
Second control signal output module, for when receiver module receives the second status signal, export the second control signal to charging indicator light control circuit, make it to export high level with the voltage drawing high GPIO pin end, be in OFF state to make charging indicator light;
GPIO pin end acquiescence output low level, the second reference voltage input terminal VDD gives tacit consent to voltage supply, and the low level that GPIO pin end acquiescence exports drawn high, charging indicator light LED is in OFF state; When the charger energising of terminal, charging indicator light LED can not be lit at once;
Described charging indicator light control circuit also comprises the 3rd resistance, and one end of described 3rd resistance connects the second reference voltage, and the other end is connected between described GPIO pin and described first metal-oxide-semiconductor.
For solving the problems of the technologies described above, another technical scheme that the present invention adopts is:
A kind of charging device, comprises above-mentioned charging indicator light control circuit and above-mentioned charging indicator light control device.
The invention has the beneficial effects as follows: the situation being different from prior art, the present invention is in charging indicator light control circuit, between control pin GPIO and the first metal-oxide-semiconductor, the second reference voltage is set, when non-charging, the output level of pin GPIO is drawn high by this second reference voltage, make the first metal-oxide-semiconductor conducting, second metal-oxide-semiconductor cut-off, thus make charging indicator light be in OFF state; When terminal detects that battery ID is correct and charges to battery, the output level of pin GPIO drags down by the second reference voltage, makes the first metal-oxide-semiconductor cut-off, the second metal-oxide-semiconductor conducting, thus is lighted by charging indicator light; The charging indicator light control circuit of the application of the invention, when charger one is plugged, indicator light can not be lit at once, but detects that when charging to battery, indicator light is just lighted, and can solve the problem of terminal charge indicator light misdirection.
Embodiment
Consult Fig. 2, embodiment of the present invention charging indicator light control circuit comprises:
First reference voltage input terminal VCHG, the first metal-oxide-semiconductor Q1, GPIO pin end, the second reference voltage input terminal VDD, charging indicator light LED and the second metal-oxide-semiconductor Q2;
Wherein, the drain electrode of the first metal-oxide-semiconductor Q1 connects the first reference voltage input terminal VCHG, one end of GPIO pin end connects the grid of the first metal-oxide-semiconductor Q1, GPIO pin end acquiescence output low level signal, second reference voltage input terminal VDD is connected between GPIO pin end and the first metal-oxide-semiconductor Q1, second reference voltage input terminal VDD is for drawing high the outputs level signals of GPIO pin end, the first end of charging indicator light LED connects the first reference voltage input terminal VCHG, second end connects the drain electrode of the second metal-oxide-semiconductor Q2, the grid of the second metal-oxide-semiconductor Q2 is connected between the drain electrode of the first reference voltage input terminal VCHG and the first metal-oxide-semiconductor Q1,
In the present embodiment, GPIO pin end acquiescence output low level, the second reference voltage input terminal VDD gives tacit consent to voltage supply, the low level that GPIO pin end acquiescence exports is drawn high, thus making the first metal-oxide-semiconductor Q1 conducting and the second metal-oxide-semiconductor Q2 ends, charging indicator light LED is in OFF state; So when the charger energising of terminal, charging indicator light LED can not be lit at once, only have when the state-detection of terminal to battery complete and determine that battery is in charged state time, second reference voltage input terminal VDD not voltage supply is set, now, first metal-oxide-semiconductor Q1 ends and the second metal-oxide-semiconductor Q2 conducting, and charging indicator light LED is in and is lit; When charging is complete, or terminal detects that battery temperature is too high and stops when charging to battery, recovers the voltage supply of two reference voltage VDD, draws high the output level of GPIO pin end, thus making the first metal-oxide-semiconductor Q1 conducting and the second metal-oxide-semiconductor Q2 ends, charging indicator light LED is extinguished;
In a particular embodiment, the source electrode of the first metal-oxide-semiconductor Q1 can ground connection, also can connect the first voltage providing end, and the input voltage of the first voltage providing end is less than the input voltage of the first reference voltage input terminal VCHG;
The source electrode of the second metal-oxide-semiconductor Q2 can ground connection, also can connect the second voltage providing end, and the input voltage of the second voltage providing end is less than the input voltage of the second reference voltage input terminal VDD;
Further, charging indicator light control circuit in the present embodiment can also comprise the first resistance R1, first resistance R1 is arranged between the first reference voltage input terminal VCHG and the first metal-oxide-semiconductor Q1, namely one end of the first resistance R1 connects the first reference voltage input terminal VCHG, and the other end connects the drain electrode of the first metal-oxide-semiconductor Q1; First resistance R1 can avoid the situation of circuit accidental short circuit, improves the security performance of circuit;
Further, charging indicator light control circuit in the present embodiment can also comprise the second resistance R2, second resistance R2 is arranged between charging indicator light LED and the second metal-oxide-semiconductor Q2, and namely one end of the second resistance R2 connects charging indicator light LED, and the other end connects the drain electrode of the second metal-oxide-semiconductor Q2; Second resistance R2 can limit the voltage at charging indicator light LED two ends, charging indicator light LED is played to the effect of protection; Second resistance can be adjustable resistance, for regulating the brightness of charging indicator light LED;
Further, the charging indicator light control circuit in the present embodiment can also comprise the 3rd resistance R3, and one end of the 3rd resistance R3 connects the second reference voltage input terminal VDD, and the other end is connected between GPIO pin end and the first metal-oxide-semiconductor Q1; For avoiding producing too much electric current on the 3rd resistance R3, the resistance value of the 3rd resistance R3 can be set as 100 kilo-ohms; 3rd resistance R3 is arranged in order to avoid the overtension of the second reference voltage input terminal VDD;
Operation principle the following detailed description of charging indicator light control circuit in the present embodiment:
After terminal plugs battery charger, the second reference voltage input terminal VDD gives tacit consent to voltage supply, and draw high the level that GPIO pin end exports, thus make the first metal-oxide-semiconductor Q1 conducting and the second metal-oxide-semiconductor Q2 ends, charging indicator light LED is in OFF state;
When terminal detects the ID of battery and the temperature of battery and judges that terminal can be charged and charge to terminal, second reference voltage input terminal VDD not voltage supply, the level of the output of GPIO pin end is dragged down, namely the grid voltage of the first metal-oxide-semiconductor Q1 is zero volt, now the first metal-oxide-semiconductor Q1 ends, the grid voltage of the second metal-oxide-semiconductor Q2 is just the first reference voltage input terminal VCHG, the second metal-oxide-semiconductor Q2 conducting, and charging indicator light LED is lit;
After charging, or in charging process, terminal detects that battery temperature is too high and stops when charging to battery, recovers the voltage supply of the second reference voltage input terminal VDD, then the first metal-oxide-semiconductor Q1 conducting and the second metal-oxide-semiconductor Q2 end, and charging indicator light LED is extinguished;
It is pointed out that terminal is carried out detecting can be realized by the method for software approach or software and hardware combining the ID of battery and the temperature of battery etc., prior art is comparative maturity, is not emphasis of the present invention herein, does not repeat herein.
More than can find out, in the present embodiment, by in charging indicator light control circuit, between control pin GPIO and the first metal-oxide-semiconductor Q1, the second reference voltage input terminal VDD is set, the voltage supply of this second reference voltage acquiescence, draws high the output level of pin GPIO, makes the first metal-oxide-semiconductor Q1 conducting, second metal-oxide-semiconductor Q2 ends, thus makes charging indicator light LED be in OFF state; When the second reference voltage input terminal VDD not voltage supply, pin GPIO output low level, the first metal-oxide-semiconductor Q1 ends, the second metal-oxide-semiconductor Q2 conducting, thus lights charging indicator light LED; By controlling the second reference voltage input terminal VDD determining voltage supply when battery is in charged state, the not voltage supply when battery is not in charged state, thus the correct instruction that charging indicator light can be guaranteed.
Refer to Fig. 3, in the embodiment of the present invention, the first embodiment of charging indicator light control method comprises:
301, the first status signal that battery charger exports is received;
When battery charger detects that battery changes charged state into from non-charged state, export the first status signal to charging indicator light control device, wherein the first status signal shows that battery is in charged state;
After charging indicator light control device receives the first status signal of battery charger output, perform step 302; Wherein, charging indicator light control device can be the main control chip of terminal, can be also other control chips or device, limit herein;
302, the first control signal is exported to charging indicator light control circuit;
Charging indicator light control device exports the first control signal to charging indicator light control circuit, makes it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light after receiving the first status signal of battery charger output;
In the present embodiment, when charging indicator light control device receive battery change charged state into from non-charged state time, the first status signal that battery charger exports, then the first control signal is exported to charging indicator light control circuit, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light; Thus ensure that battery is in charged state really, charging indicator light is just lit, thus ensure that the correct instruction of charging indicator light.
Refer to Fig. 4, in the embodiment of the present invention, the second embodiment of charging indicator light control method comprises:
401, the first status signal that battery charger exports is received;
When battery charger detects that battery changes charged state into from non-charged state, export the first status signal to main control chip, wherein the first status signal shows that battery is in charged state;
After main control chip receives the first status signal of battery charger output, perform step 402;
Concrete:
First pin of main control chip connects battery charger, and wherein concrete link position is prior art, is not emphasis of the present invention, does not repeat herein;
Second pin of main control chip connects battery charger, wherein concrete link position, and such as, Fig. 2 is the circuit diagram of the control circuit embodiment of invention charging indicator light, and in fig. 2, the second pin of main control chip connects the second reference voltage input terminal VDD;
402, the first control signal is exported to charging indicator light control circuit;
Main control chip exports the first control signal to charging indicator light control circuit, makes it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light after receiving the first status signal of battery charger output;
Same for the circuit diagram of Fig. 2, main control chip exports the first control signal to charging indicator light control circuit, control the second reference voltage input terminal VDD not voltage supply, namely the voltage of the second reference voltage input terminal VDD is zero, thus dragged down the voltage of GPIO pin end, GPIO pin end output low level, so the first metal-oxide-semiconductor Q1 ends, second metal-oxide-semiconductor Q2 conducting, indicator light LED is lit;
403, the second status signal that battery charger exports is received;
When battery charger detects that battery changes non-charged state into from charged state, export the second status signal to main control chip, after main control chip receives the second status signal of battery charger output, perform step 404;
404, the second control signal is exported to charging indicator light control circuit;
Main control chip exports the second control signal to charging indicator light control circuit after receiving the second status signal of battery charger output, makes it to export high level, be in OFF state to make charging indicator light with the voltage drawing high GPIO pin end;
Same for the circuit diagram of Fig. 2, main control chip exports the second control signal to charging indicator light control circuit, recover the voltage supply of the second reference voltage input terminal VDD, namely the voltage of the second reference voltage input terminal VDD is non-vanishing and be less than the first reference voltage input terminal VCHG, thus drawn high the voltage of GPIO pin end, GPIO pin end exports high level, so the first metal-oxide-semiconductor Q1 conducting, second metal-oxide-semiconductor Q2 ends, and indicator light LED is extinguished;
So when one plugs charger, because whether need to detect battery ID correct, whether battery temperature is applicable to charging etc., and battery can not be in charged state, and indicator light also should not be lit at once at once; By the method in the embodiment of the present invention, when detecting that battery is in charged state really, charging indicator light is just lit; And if detect that in charging process battery temperature is too high, be not suitable for continuing charging, for the purpose of safety, need to stop battery charging, now charging indicator light should extinguish immediately at once; By the method in the embodiment of the present invention, when battery runs down being detected, when not being in charged state, charging indicator light is extinguished; So the method provided in the present embodiment can guarantee the correct instruction of charging indicator light.
Refer to Fig. 5, in the embodiment of the present invention, the first embodiment of charging indicator light control device comprises:
Receiver module 501, for receiving the first status signal that battery charger exports, this first status signal shows that battery is in charged state;
First control signal output module 502, for when receiver module 501 receives the first status signal, export the first control signal to charging indicator light control circuit, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light;
In the present embodiment, when charging indicator light control device receive battery change charged state into from non-charged state time, the first status signal that battery charger exports, then the first control signal is exported to charging indicator light control circuit, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light; Thus ensure that battery is in charged state really, charging indicator light is just lit, thus ensure that the correct instruction of charging indicator light.
Refer to Fig. 6, in the embodiment of the present invention, the second embodiment of charging indicator light control device comprises:
Receiver module 601, for receiving the first status signal and second status signal of battery charger output, wherein the first status signal shows that battery is in charged state, and the second status signal shows that battery is in non-charged state;
First control signal output module 602, for when receiver module 601 receives the first status signal, export the first control signal to charging indicator light control circuit, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light;
This charging indicator light control device also comprises:
Second control signal output module 603, for when receiver module 601 receives the second status signal, export the second control signal to charging indicator light control circuit, make it to export high level with the voltage drawing high GPIO pin end, be in OFF state to make charging indicator light;
In the present embodiment, when charging indicator light control device receive battery change charged state into from non-charged state time, the first status signal that battery charger exports, then the first control signal is exported to charging indicator light control circuit, make it output low level with the voltage dragging down GPIO pin end, be in illuminating state to make charging indicator light; When charging indicator light control device receive battery change non-charged state into from charged state time, the second status signal that battery charger exports, then the second control signal is exported to charging indicator light control circuit, make it to export high level with the voltage drawing high GPIO pin end, be in OFF state to make charging indicator light; Thus ensure that battery is in charged state really, charging indicator light is just lit, thus ensure that the correct instruction of charging indicator light.
In the embodiment of another charging device of the present invention, this charging device includes the charging indicator light control circuit in above-described embodiment, and charging indicator light control device; The detailed description of this charging indicator light control circuit and charging indicator light control device refers to above-described embodiment, does not repeat herein; This charging indicator light control circuit is set in charging device, can better for the battery charge condition of charging device indicates, solve terminal and do not consider that whether the ID detection of battery is correct or whether battery temperature is too high, charging circuit is actual is in off-state, and charging indicator light is in the problem of illuminating state, i.e. the problem of indicator light misdirection.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.