Disclosure of Invention
The invention solves the technical problem of how to reduce the influence on the service life of a rechargeable battery in a rechargeable portable lamp during charging and lighting.
In order to solve the above technical problem, an embodiment of the present invention provides a control method for a portable lamp, where the portable lamp includes a rechargeable battery and a lighting circuit, the lighting circuit is coupled to the rechargeable battery, and both the lighting circuit and the rechargeable battery are adaptable to an external power supply, and the control method includes: detecting whether the portable lamp is externally connected with a power supply or not; when the portable lamp is externally connected with a power supply and an illumination control instruction is detected, the working current of the illumination circuit is adjusted, and the current state of the rechargeable battery is detected at the same time, so that the rechargeable battery is always in a charging state.
Optionally, the detecting the current state of the rechargeable battery includes: and detecting the charging current and the discharging current of the rechargeable battery by adopting a battery state detection circuit, and determining the current state of the rechargeable battery according to the detected charging current and discharging current.
Optionally, the adjusting the operating current of the lighting circuit comprises: reducing an operating current of the lighting circuit.
Optionally, the lighting control instruction is input in any one of the following manners: a manner of touch interface; a key pressing mode; a manner of speech; the remote control mode.
An embodiment of the present invention further provides a portable lamp, including: a rechargeable battery; a lighting circuit; an input circuit adapted to input a lighting control instruction; a current regulating circuit adapted to regulate an operating current of the lighting circuit; a battery state detection circuit adapted to detect a current state of the rechargeable battery; and the control circuit is coupled with the input circuit, the current regulating circuit and the battery state detection circuit, is suitable for controlling the current regulating circuit to regulate the working current of the lighting circuit and simultaneously controlling the battery state detection circuit to detect the current state of the rechargeable battery when the portable lamp is externally connected with a power supply and detects a lighting control command so as to keep the rechargeable battery in a charging state all the time.
Optionally, the battery state detection circuit is adapted to detect a charging current and a discharging current of the rechargeable battery, and input a detection result to the control circuit.
Optionally, the battery state detection circuit includes: a first detection sub-circuit adapted to detect a charging current of the rechargeable battery, and a second detection sub-circuit adapted to detect a discharging current of the rechargeable battery.
Optionally, the first detection sub-circuit and the second detection sub-circuit have the same structure, and both include: first resistance, second resistance, amplifier, PMOS pipe and third resistance, wherein: the first resistor is coupled with the negative phase input end of the amplifier and the source electrode of the PMOS tube; the second resistor is coupled with a non-inverting input end of the amplifier; the output end of the amplifier is coupled with the grid electrode of the PMOS tube; the source electrode of the PMOS tube is coupled with the substrate, and the drain electrode of the PMOS tube is grounded through the third resistor; the first resistor and the second resistor have the same resistance value.
Optionally, the portable luminaire further comprises: a first voltage conversion circuit and a second voltage conversion circuit, wherein: the input end of the first voltage conversion circuit is coupled with the charging port, the output end of the first voltage conversion circuit is coupled with the rechargeable battery and the control circuit, and the first voltage conversion circuit is suitable for performing voltage conversion on the voltage input by the charging port to obtain the voltage suitable for being input to the rechargeable battery and the control circuit; the input end of the second voltage conversion circuit is coupled with the first voltage conversion circuit, the output end of the second voltage conversion circuit is coupled with the current regulation circuit, and the second voltage conversion circuit is suitable for performing voltage conversion on the first voltage conversion circuit to obtain a working voltage suitable for the lighting circuit to work and maintaining the working voltage at a preset second voltage value.
Optionally, the current regulating circuit is adapted to reduce the operating current of the lighting circuit when the rechargeable battery is in a charging state and a lighting control instruction is received.
Optionally, the portable luminaire further comprises: and the circuit detection circuit is coupled with the current regulation circuit, is suitable for detecting the working current of the lighting circuit and feeds the working current back to the control circuit.
Optionally, the input circuit of the portable lamp is any one of: a touch interface; a voice unit; a key sheet; a remote instruction receiving unit.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
by adopting the scheme, because one part of the current input when the portable lamp is externally connected with the power supply is used as the working current of the portable lamp, and the other part of the current is used as the charging current of the rechargeable battery, when the portable lamp is externally connected with the power supply and the illumination control instruction is detected, the working current of the portable lamp is adjusted, so that the rechargeable battery is always in a charging state, the repeated switching of the charging and discharging states of the rechargeable battery can be avoided, the charging and discharging times of the rechargeable battery are reduced, and the service life of the rechargeable battery can be prolonged.
Detailed Description
In the conventional portable lamp, a certain fixed current value is generally used as an operating current. The portable lamp is externally connected with a power supply, and the current input by the external power supply is used as the working current of the portable lamp on the one hand and the charging current of a rechargeable battery in the portable lamp on the other hand. In order to ensure that the portable lamp operates at the fixed current value, the rechargeable battery is often switched from the current charging state to the discharging state to provide sufficient operating current for the portable lamp, which generally increases the charging and discharging times of the rechargeable battery and affects the life of the rechargeable battery.
In view of the above problems, embodiments of the present invention provide a method for controlling a portable lamp, in which a working current of the portable lamp is adjusted when the portable lamp is connected to an external power source and an illumination control command is detected, so that the rechargeable battery is always in a charging state, thereby avoiding repeated switching of charging and discharging states of the rechargeable battery, reducing the charging and discharging times of the rechargeable battery, and improving the service life of the rechargeable battery.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Referring to fig. 1, an embodiment of the present invention provides a method for controlling a portable lamp.
First, in order to make those skilled in the art better understand the control method, the portable lamp is explained as follows: and a rechargeable battery is arranged in the portable lamp. Through setting up the external power supply of charging mouth on portable lamps and lanterns surface, can provide operating current for portable lamps and lanterns on the one hand, on the other hand can be for rechargeable battery charges.
In a specific implementation, the control method may include the steps of:
and 11, detecting whether the portable lamp is externally connected with a power supply.
In specific implementation, various methods may be adopted to detect whether the portable lamp is externally connected to a power supply, for example, whether a current input from a charging port of the portable lamp is greater than 0 may be detected. And when the current input by the charging port of the portable lamp is greater than 0, determining that the portable lamp is externally connected with a power supply, otherwise, determining that the portable lamp is not externally connected with the power supply.
The external power supply can be a charger, a mains supply and the like, and the charging port on the surface of the portable lamp can be a USB port and the like.
And step 12, when the portable lamp is externally connected with a power supply and an illumination control instruction is detected, adjusting the working current of the illumination circuit, and simultaneously detecting the current state of the rechargeable battery so as to keep the rechargeable battery in a charging state all the time.
In specific implementations, the lighting control command may be input in various ways, and is not limited in particular. For example, a touch interface may be disposed on the portable lamp, and the lighting control instruction is input through the touch interface. The portable lamp can also be provided with a corresponding key board, and the lighting control instruction is input through keys on the key board. The portable lamp can also be provided with a corresponding radio, such as a microphone, and the lighting control instruction in the form of voice is input through the radio. The portable lamp can be bound with a control terminal such as a mobile phone, and the illumination control instruction is input in a remote control mode.
In a specific implementation, when the portable lamp is externally connected with a power supply and an illumination control command is detected, the working current of the portable lamp can be reduced. Because one part of the current input by the portable lamp when being externally connected with the power supply is used as the working current of the portable lamp, and the other part of the current is used as the charging current of the rechargeable battery, the working current of the portable lamp is reduced under the condition that the current input by the external power supply to the portable lamp is constant, so that the charging current of the rechargeable battery can be increased, the rechargeable battery can be maintained in a charging state, the switching of the charging and discharging states of the rechargeable battery is avoided, the charging and discharging times of the rechargeable battery are reduced, and the service life of the rechargeable battery can be prolonged. Of course, when the charging current of the rechargeable battery reaches the preset current value, the working current of the portable lamp can be increased as long as the rechargeable battery is maintained in the charging state.
In particular implementations, the current state of the rechargeable battery may be detected in a variety of ways. In an embodiment of the present invention, a battery status detection circuit may be used to detect the current status of the rechargeable battery.
Further, in order to more accurately detect the current state of the rechargeable battery, a battery state detection circuit may be used to detect the charging current and the discharging current of the rechargeable battery, and then the current state of the rechargeable battery may be determined according to the detected charging current and discharging current.
For example, when the charging current of the rechargeable battery is greater than 0, it is determined that the rechargeable battery is in a charging state. And when the discharge current of the rechargeable battery is larger than 0, determining that the rechargeable battery is in a discharge state.
In specific implementation, the rechargeable battery may be a nickel-cadmium battery, a nickel-hydrogen battery, a lithium ion battery, a lead storage battery, a lithium iron battery, or the like, and may be specifically set according to actual needs of the portable lamp.
In specific implementation, the portable lamp may be any one of a flashlight, a desk lamp, and the like, and is not limited specifically. It is understood that the specific portable light fixture is not intended to limit the present invention and is within the scope of the present invention.
As can be seen from the above, in the control method of the portable lamp in the embodiment of the present invention, when the portable lamp is externally connected to the power supply and the lighting control instruction is detected, the working current of the portable lamp is adjusted, so that the rechargeable battery can be maintained in the charging state, and the service life of the rechargeable battery can be prolonged.
In order to make those skilled in the art better understand and implement the present invention, the following detailed description is provided for a portable lamp corresponding to the above-mentioned control method of the portable lamp.
Referring to the schematic circuit structure diagrams of the portable lamp shown in fig. 2 to 4, the circuit structure of the portable lamp may specifically include the following components:
a rechargeable battery 21;
an illumination circuit 22;
an input circuit SW1 adapted to input a lighting control instruction;
a current regulating circuit 23 adapted to regulate an operating current of the lighting circuit 22;
a battery state detection circuit 24 adapted to detect a current state of the rechargeable battery 21;
and the control circuit U3 is adapted to control the current regulating circuit 23 to regulate the working current of the lighting circuit and simultaneously control the battery state detection circuit 24 to detect the current state of the rechargeable battery when the portable lamp is externally connected with a power supply and detects a lighting control instruction, so as to keep the rechargeable battery in a charging state all the time.
In a specific implementation, the charging port of the portable lamp may be a USB interface, or may be other types of interfaces. Taking the USB interface as the charging port of the portable lamp as an example, the control circuit U3 may be coupled to the USB interface through the resistor R14, and may determine whether the portable lamp is externally connected to the power supply by detecting whether the voltage value of the USB sense at the intermediate node between the resistor R14 and the resistor R15 reaches a preset first voltage value.
In a specific implementation, the portable lamp may further include a first voltage conversion circuit U1 and a second voltage conversion circuit.
The input end of the first voltage conversion circuit U1 may be coupled to the USB interface, and the output end is coupled to the transistor Q3 and the sampling resistor Rcs, so as to convert the voltage of the power supply input from the USB interface to obtain a voltage suitable for the transistor Q3 and the rechargeable battery 21 to operate. For example, the power voltage input by the USB interface may be 5V, and after the voltage conversion by the first voltage conversion circuit U1, a voltage between 3.7V and 4.2V may be obtained. The first voltage conversion circuit U1 provides a charging voltage to the rechargeable battery 21 through the resistor Rcs, and provides a power supply voltage VCC to the control circuit U3 and the lighting circuit 22 through the transistor Q3.
The input end of the second voltage conversion circuit is coupled to the output end of the first voltage conversion circuit U1, the output end of the second voltage conversion circuit is coupled to the current regulation circuit 23, and the second voltage conversion circuit is adapted to perform further voltage conversion on the voltage converted by the first voltage conversion circuit U1 under the control of the enable signal EN output by the control circuit U3 to obtain a working voltage suitable for the lighting circuit 22 to work, and maintain the working voltage at a preset second voltage value. For example, when the output voltage of the first voltage conversion circuit U1 is 3.7V, a stable 6V voltage can be obtained after conversion by the second voltage conversion circuit U2.
Specifically, the second voltage conversion circuit may include: a voltage conversion sub-circuit U2 and a voltage regulation sub-circuit. The voltage regulation sub-circuit may include: inductor L1, diode D3, resistance R3, resistance R4, electric capacity C3 and electric capacity C4. The inductor L1 is connected in parallel with the voltage conversion sub-circuit U2, the resistor R3 is connected in parallel with the capacitor C, and the resistor R3 is connected in series with the resistor R4 and then connected in parallel with the capacitor C4. The diode D3 is coupled between the inductor L1 and the resistor R3. The middle node FB of the resistor R3 and the resistor R4 is connected to the FB pin of the voltage converting sub-circuit U2, and is adapted to couple to the voltage converting sub-circuit U2 and feed the regulated voltage back to the voltage converting sub-circuit U2.
In a specific implementation, the current regulating circuit 23 may include: the lighting circuit 22 and the second voltage conversion circuit are coupled to an NMOS transistor Q1, the second voltage conversion circuit is coupled to an NMOS transistor Q2, a resistor R6 is coupled between the gate of the NMOS transistor Q1 and the drain of the NMOS transistor Q2, a capacitor C2 is coupled between the gate of the NMOS transistor Q1 and the ground, the gate of the NMOS transistor Q2 is coupled to the control circuit U3, and the source of the NMOS transistor Q1 is grounded through a resistor RS. The control circuit U3 outputs the driving signal DRV through the resistor R5, and adjusts the pulse width of the NMOS transistor Q2 according to the driving signal DRV, thereby changing the drain current of the NMOS transistor Q1. Since the lighting circuit 22 is connected in series with the NMOS transistor Q1, changing the drain current of the NMOS transistor Q1 is equivalent to changing the working current of the lighting circuit 22, thereby achieving the purpose of adjusting the working current of the lighting circuit 22.
In a specific implementation, the portable light fixture may further include: and a current detection circuit 25 adapted to detect the operating current of the lighting circuit 22 and input the detection result to the pin CC of the control circuit U3. Specifically, the current detection circuit 25 may include: operational amplifier U4, resistor R7, resistor R8, and resistor R9. The positive phase input terminal of the operational amplifier U4 is coupled to the source of the NMOS transistor Q1 through a resistor R7, and the negative phase input terminal is coupled to ground through a resistor R8. The resistor R9 is coupled between the negative phase input terminal and the output terminal of the operational amplifier U4. The voltage difference between both ends of the detection resistor RS is amplified, and the amplified result is input to the control circuit U3, so that the control circuit U3 can know the operating current of the lighting circuit 22.
In an implementation, the lighting circuit 22 is coupled to the second voltage conversion circuit U2, the current detection circuit 25 and the control circuit U3 through two four-pin connectors CON3 and CON4, which may be coupled. In an embodiment of the present invention, the 4 th pin and the 3 rd pin of the four-pin connector CON3 may be connected in series with a temperature sensitive resistor NTC, and the 1 st pin of the four-pin connector CON4 is coupled to an NTC _ AD pin of the control circuit U3, through which the operating temperature of the lighting circuit 22 may be detected.
In an embodiment of the present invention, the lighting circuit 22 is composed of four LED lamp sets connected in parallel, each LED lamp set includes two LED lamps connected in series, specifically, LED lamps D2-D4 and D8-D12.
In an implementation, the input circuit SW1 is coupled to the control circuit U3 via two five-pin connectors CON1 and CON2, which may be coupled. The input circuit SW1 may be a touch interface, and the lighting control instruction is input through the touch interface unit; the user can input different lighting control instructions in the modes of key pressing times, intensity and the like; it is also possible to have a corresponding speech unit, such as a microphone, by means of which the lighting control instructions are entered in speech form. In a specific implementation, the input circuit SW1 may be a remote instruction receiving unit, the portable lamp is bound with a control terminal such as a mobile phone through the remote instruction receiving unit, and the lighting control instruction is input through a remote control mode.
In an embodiment of the present invention, the portable lighting device may further include: and an indicating circuit 26 for indicating the current state of the rechargeable battery 21. For example, the indication circuit may be provided with two LED lamps r (red LED) and y (yellow LED) on the keypad, and the LEDs are coupled to the control circuit U3 through five-pin connectors CON1 and CON 2. After the control circuit U3 knows the current status of the rechargeable battery 21, it can indicate this by controlling the LED light.
In an embodiment of the present invention, the battery state detection circuit 24 is adapted to detect the charging current Charge AD and the discharging current Discharge AD of the rechargeable battery 21, and input the detection results to corresponding pins of the control circuit U3, and the control circuit U3 determines the current state of the rechargeable battery 21 according to the detection results.
In a specific implementation, referring to fig. 2, the battery status detection circuit 24 may include: a first detection sub-circuit U5 and a second detection sub-circuit U6. Wherein the first detection sub-circuit U5 is adapted to detect a charging current of the rechargeable battery 21, and the second detection sub-circuit U6 is adapted to detect a discharging current of the rechargeable battery 21.
The control circuit U3 determines that the rechargeable battery 21 is in the charged state when the charging current Charge AD of the rechargeable battery 21 is > 0, and determines that the rechargeable battery 21 is in the discharged state when the discharging current Discharge AD of the rechargeable battery 21 is < 0.
In an implementation, referring to fig. 2 and 5, the first detection sub-circuit U5 and the second detection sub-circuit U6 may have various circuit structures, and are not limited. In an embodiment of the invention, the first detecting sub-circuit U5 and the second detecting sub-circuit U6 have the same structure, and both of them may include: first resistance R1, second resistance R2, amplifier AP, PMOS pipe P1 and third resistance R3, wherein:
the first resistor R1 is coupled to the negative input terminal of the amplifier AP and the source of the PMOS transistor P1. The second resistor R2 is coupled to the non-inverting input of the amplifier AP. The output end of the amplifier AP is coupled with the grid electrode of the PMOS pipe P1. The source of the PMOS transistor P1 is coupled to the substrate, and the drain is grounded through the third resistor R3. The first resistor R1 and the second resistor R2 have the same resistance.
In an implementation, referring to fig. 2 and 5, a charging current of the rechargeable battery 21 is input to the rechargeable battery 21 through the sampling resistor Rcs, and a discharging current of the rechargeable battery 21 supplies power to the lighting 22 through the sampling resistor Rcs.
Specifically, in the first detection sub-circuit U5, the RS-terminal of the first resistor R1 is coupled to the first terminal k of the sampling resistor Rcs, and the RS + terminal of the second resistor R2 is coupled to the second terminal m of the sampling resistor Rcs. In the second detection sub-circuit 252, the RS + terminal of the first resistor R1 is coupled to the second terminal m of the sampling resistor Rcs, and the RS-terminal of the second resistor R2 is coupled to the first terminal k of the sampling resistor Rcs.
The first detection sub-circuit U5 and the second detection sub-circuit U6 may amplify a voltage difference across the sampling resistor Rcs. When the rechargeable battery 21 is discharged, the PMOS transistor P1 of the first detection sub-circuit U5 is turned on, and the output discharge current DischargeAD is (V1 × R1)/(Rcs × R3), where V1 is the voltage at the output end out of the first detection sub-circuit 251. When the rechargeable battery 21 is charged, the PMOS transistor P1 of the second detection sub-circuit U6 is turned on, and the charging current flow Charge AD is (V2 × R1)/(Rcs × R3), where V2 is the voltage at the output end out of the second detection sub-circuit 252.
In a specific implementation, the gains of the amplifiers in the first detection sub-circuit U5 and the second detection sub-circuit U6, and the resistances of the first resistor R1 and the third resistor R3 can be selected according to actual conditions. For example, the gain of the amplifier may be 25, the first resistor R1 may have a resistance of 400 ohms, and the third resistor R3 may have a resistance of 10 ohms. The gain of the amplifier may also be 100, the first resistor R1 may have a resistance of 100 ohms, and the third resistor R3 may have a resistance of 10 ohms. The gain of the amplifier may also be 200, with the first resistor R1 having a resistance of 100 ohms and the third resistor R3 having a resistance of 20 ohms.
In an implementation, the MCLR and PGC pins of the control circuit U3 are used for programming corresponding control programs, and the DGND and PGD pins are ground pins.
In a specific implementation, referring to fig. 2, after the portable lamp is externally connected to the power supply, the first voltage conversion circuit U1 performs voltage conversion on the voltage input by the external power supply, and then provides a power supply voltage for other circuits of the portable lamp. When a user inputs a lighting control instruction through the input circuit SW1, the control circuit U3 sends the enable signal EN to the second voltage conversion circuit U2 and the drive signal DRV to the current adjustment circuit 23 after detecting the lighting control instruction. The control circuit U3 monitors the current state of the rechargeable battery 21 in real time through the battery state detection circuit 24, and adjusts the operating current of the lighting circuit 22 through the current adjustment circuit 23, so that the rechargeable battery 21 is maintained in a charging state, thereby improving the service life of the rechargeable battery.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.