Disclosure of Invention
The embodiment of the invention provides an LED brightness adjusting circuit, which aims to solve the problem that the current LED brightness adjusting cost is high.
The embodiment of the invention provides an LED brightness adjusting circuit which comprises a brightness adjusting module and a parameter adjusting module, wherein,
The brightness adjusting module comprises a light emitting diode to be controlled and a transistor connected in series with the light emitting diode, and is used for adjusting the brightness of the light emitting diode according to the input parameters of the transistor;
the parameter adjusting module is used for being connected with an IO port of the main control chip through at least one signal input end and adjusting the input parameters according to the output state of the IO port.
Optionally, the transistor is an NPN transistor.
Optionally, the brightness adjusting module further includes a first resistor, the first resistor is connected in series between the negative electrode of the light emitting diode and the collector electrode of the transistor, the positive electrode of the light emitting diode is connected with a working power supply, and the emitter electrode of the transistor is grounded.
Optionally, the parameter adjusting module includes a first signal input end, a second resistor and a third resistor, the second resistor is connected in series between the first signal input end and the base of the transistor, one end of the third resistor is connected between the first signal input end and the second resistor, and the other end of the third resistor is connected with the working power supply.
Optionally, the first resistor is 18 ohms, the second resistor is 1 kilo ohms, the third resistor is 4.2 kilo ohms, the working voltage of the light emitting diode is 1.5 volts, the maximum working current is 100 milliamperes, and the current amplification factor of the transistor is 100.
Optionally, the parameter adjusting module includes a second signal input end, a third signal input end, a fourth resistor and a fifth resistor, the fourth resistor and the fifth resistor are connected in series between the second signal input end and the third signal input end, and a base electrode of the transistor is connected between the fourth resistor and the fifth resistor.
Optionally, the first resistor is 18 ohms, the fourth resistor is 3.5 kiloohms, the fifth resistor is 7 kiloohms, the operating voltage of the light emitting diode is 1.5 volts, the maximum operating current is 100 milliamperes, and the current amplification factor of the transistor is 100.
Optionally, the working power supply is a 3.3 volt direct current power supply.
Optionally, the output states include a low state, a hover state, and a high state.
Optionally, the IO port is a general IO port of the main control chip.
The embodiment of the invention provides an LED brightness adjusting circuit, which comprises a brightness adjusting module and a parameter adjusting module, wherein the brightness adjusting module comprises a light emitting diode to be controlled and a transistor connected with the light emitting diode in series, the parameter adjusting module comprises at least one signal input end connected with an IO port of a main control chip, and the input parameters of the transistor are adjusted through different output states of the IO port of the main control chip so as to obtain different output currents of the transistor, thereby realizing brightness adjustment of the light emitting diode. According to the LED brightness adjusting circuit provided by the embodiment of the invention, a main control chip is not required to be provided with a special IO port for realizing a special function, namely, a special chip is not required to be used, and on the basis of providing various brightness level control, the realization cost is effectively reduced, so that the user experience of a product is improved, and the product value is improved.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Furthermore, the terms "first," "second," and the like, may be used herein to describe various directions, acts, steps, or elements, etc., but these directions, acts, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, a first resistance may be referred to as a second resistance, and similarly, a second resistance may be referred to as a first resistance, without departing from the scope of embodiments of the present invention. Both the first resistor and the second resistor are resistors, but they are not the same resistor. The terms "first," "second," and the like, are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the embodiments of the present invention, the meaning of "plurality" is at least two, for example, two, three, etc., unless explicitly defined otherwise.
Example 1
Fig. 1 is a schematic structural diagram of an LED brightness adjustment circuit according to an embodiment of the present invention, which is applicable to the situation of brightness adjustment of LEDs in various situations. As shown in fig. 1, the brightness adjusting circuit 100 includes a brightness adjusting module 110 and a parameter adjusting module 120, wherein the brightness adjusting module 110 includes a light emitting diode to be controlled and a transistor connected in series with the light emitting diode, the brightness adjusting module 110 is configured to adjust brightness of the light emitting diode according to an input parameter of the transistor, and the parameter adjusting module 120 is configured to connect with an IO port of a main control chip through at least one signal input end IO and adjust the input parameter according to an output state of the IO port.
Specifically, as a Light Emitting Diode (LED) as a light emitting element, there are two pins, and as long as a current is formed by applying a suitable driving voltage, the LED emits light, and the intensity of the emitted light is related to power, and the power is equal to the voltage multiplied by the current. Since the LED is essentially a diode, the power of the non-linear component is approximately proportional to the current, i.e. the current is not proportional to the voltage, and its voltage does not change much after conduction. Based on this, the light emitting diode to be controlled may be connected in series with the transistor in the brightness adjusting module 110, that is, the output current of the transistor is the current of the light emitting diode, so that the brightness of the light emitting diode may be adjusted by the output current of the transistor. While the output current of the transistor may be adjusted by input parameters, which may include input current and input voltage, etc., which may be determined according to a specific transistor type, the brightness adjustment module 110 may adjust the brightness of the light emitting diode according to the input parameters to the transistor, which may be operated in an amplified state. The parameter adjusting module 120 may be connected to the IO port of the main control chip through the signal input end IO, where the IO port may be a general IO port of the main control chip, that is, no special design is needed, and as long as the main control chip has redundant general IO ports, the general IO ports may be used to realize the function of changing the brightness of the LED. The parameter adjusting module 120 may be further connected to the base of the transistor in the brightness adjusting module 110 by using a circuit formed by one or more resistors to provide input parameters for the transistor, so that different input parameters may be provided for the transistor in different output states of the IO port of the main control chip, thereby realizing adjustment of the brightness of the LED. The output states include a low level state (output low), a floating state (float), and a high level state (output high), wherein the level of the IO port is 0V in the low level state, the level of the IO port is equivalent to disconnection in the floating state, and the level of the IO port is 3.3V in the high level state. Three different input parameters can be provided by using one signal input end IO to access one IO port, and a plurality of signal input ends IO are respectively accessed to a plurality of IO ports, so that more different input parameters can be provided by combining different output states, and various multi-stage brightness adjustment can be realized according to requirements.
Based on the above technical solution, optionally, the transistor is an NPN transistor, and the brightness adjusting module 110 may specifically adjust the output current of the transistor according to the base current of the transistor, thereby adjusting the brightness of the light emitting diode.
Further optionally, as shown in fig. 2 and fig. 3, the brightness adjustment module 110 further includes a first resistor R1, where the first resistor R1 is connected in series between the negative electrode of the light emitting diode VD and the collector c of the transistor Q, the positive electrode of the light emitting diode VD is connected to the operating power source VCC, and the emitter e of the transistor Q is grounded. The working voltage and the maximum working current of the light emitting diode VD can be matched, and the light emitting diode VD can reach the maximum brightness under the limit of the working power supply VCC by selecting the first resistor R1 with proper resistance, so that the light emitting diode VD can be better utilized. Wherein, optionally, the working power supply is a 3.3V direct current power supply, which is convenient for the main control chip to provide.
Further optionally, as shown in fig. 2, the parameter adjusting module 120 includes a first signal input terminal IO1, a second resistor R2, and a third resistor R3, where the second resistor R2 is connected in series between the first signal input terminal IO1 and the base b of the transistor Q, and one end of the third resistor R3 is connected between the first signal input terminal IO1 and the second resistor R2, and the other end is connected to the operating power VCC. Specifically, the first signal input terminal IO1 may be connected to an IO port of the main control chip, when the output state of the IO port is a low level state, the voltage at two ends of the second resistor R2 is 0V, the voltage of the base b is pulled down, that is, no current flows through the base b, and the current of the collector c of the corresponding transistor Q, that is, the current of the light emitting diode VD, is 0, so that the brightness of the LED is 0. When the output state of the IO port is in a floating state, a voltage can be applied to the base b of the transistor Q through the second resistor R2 and the third resistor R3 by the operating power VCC to turn on the transistor Q. When the output state of the IO port is in a high level state, a voltage can be applied to the base b of the transistor Q through the second resistor R2 by the level output from the IO port to turn on the transistor Q. The different brightness of the LED in the floating state and the high level state can also be configured by selecting the resistance values of the second resistor R2 and the third resistor R3.
Optionally, the first resistor R1 is 18 ohms, the second resistor R2 is 1 kiloohm, the third resistor R3 is 4.2 kiloohms, the operating voltage of the light emitting diode VD is 1.5 volts, the maximum operating current is 100 milliamperes, and the current amplification factor of the transistor Q is 100. Then, as described above, in the low level state, the brightness of the LED is 0; in the suspension state, the second resistor R2 and the third resistor R3 are connected in series with a resistance value of 5.2 kiloohms, the operating power VCC applies a voltage to the base b of the transistor Q through the second resistor R2 and the third resistor R3, at this time, the level of the base b is 0.7V, the current passing through the base b= (3.3V-0.7V)/5.2 kΩ=0.5 mA, the output current of the transistor Q, i.e. the current of the collector c=0.5ma=100=50 mA, i.e. the current of the light emitting diode VD is 50mA, i.e. 50% of the maximum operating current, the brightness of the LED is 50% of the maximum brightness, in the high level state, the level of the first signal input terminal IO1 is 3.3V, and the base b of the transistor Q is applied with a voltage at this time, the level of the base b is 0.7V, the current passing through the base b= (3.3V-0.7V)/1 kΩ=2.6 mA, the current of the base c=2.6 v=1.68 v=1.5 mA, at this time, i.1 v=1 v=1.68 v=1.1 of the maximum operating current of the two ends of the resistor v=1.8, i.5 v=1.5 mA, i.1+1 v=1.1, i.1 v=1, i.1 v=1, and the current of the current at the two ends of the maximum current of the resistor at the two ends of the resistor Q is actually 1.1. By setting the single IO port to be in the low level state, the suspension state and the high level state, the light-emitting brightness of the light-emitting diode is controlled to be respectively 0, 50% of the maximum brightness and 100% of the maximum brightness, and the actual requirements under a small number of brightness levels are met.
Alternatively, as shown in fig. 3, the parameter adjustment module 120 includes a second signal input terminal IO2, a third signal input terminal IO3, a fourth resistor R4, and a fifth resistor R5, where the fourth resistor R4 and the fifth resistor R5 are connected in series between the second signal input terminal IO2 and the third signal input terminal IO3, and a base b of the transistor Q is connected between the fourth resistor R4 and the fifth resistor R5. Specifically, the second signal input end IO2 and the third signal input end IO3 may be respectively connected to two IO ports of the main control chip, and the two IO ports may also be respectively set to a low level state, a suspension state, and a high level state, so that the above-mentioned analysis process may be referred to for brightness control under various output state combination conditions.
Optionally, the first resistor R1 is 18 ohms, the fourth resistor R4 is 3.5 kiloohms, the fifth resistor R5 is 7 kiloohms, the operating voltage of the light emitting diode VD is 1.5 volts, the maximum operating current is 100 milliamperes, and the current amplification factor of the transistor Q is 100. The similar method can be used to calculate the current flowing through the light emitting diode VD in various output states, wherein the current is 0 when the second signal input end IO2 and the third signal input end IO3 are both in a low level state, the current is 0 when the second signal input end IO2 is in a low level state and the third signal input end IO3 is in a floating state, the current is 17mA when the second signal input end IO2 is in a low level state and the third signal input end IO3 is in a high level state, the current is 0 when the second signal input end IO2 is in a floating state and the third signal input end IO3 is in a low level state, the current is 0 when the second signal input end IO2 and the third signal input end IO3 are both in a floating state, the current is 37 when the second signal input end IO2 is in a high level state and the third signal input end IO3 is in a floating state, the current is 64mA when the second signal input end IO2 is in a low level state and the third signal input end IO3 is in a high level state, the second signal input end IO2 is in a high level state and the third signal input end IO3 is in a floating state, and the current is in a high level state and the second signal input end IO2 is in a floating state and the third signal input is 100mA. The different output states of the two IO ports can be set, so that the light-emitting brightness of the light-emitting diode can be controlled to be respectively 0, 17% of the maximum brightness, 37% of the maximum brightness, 64% of the maximum brightness, 74% of the maximum brightness and 100% of the maximum brightness, more brightness levels are provided, and the LED display device is applicable to more application scenes.
Similarly, more brightness level control can be achieved by modifying the number, type or parameters of the resistors or transistors, or increasing the number of IO ports of the main control chip used, etc.
The LED brightness adjusting circuit provided by the embodiment of the invention comprises a brightness adjusting module and a parameter adjusting module, wherein the brightness adjusting module comprises a light emitting diode to be controlled and a transistor connected with the light emitting diode in series, the parameter adjusting module comprises at least one signal input end connected with an IO port of a main control chip, and the input parameters of the transistor are adjusted through different output states of the IO port of the main control chip so as to obtain different output currents of the transistor, thereby realizing brightness adjustment of the light emitting diode. The special IO port for realizing the special function is not required to be arranged on the main control chip, namely, a special chip is not required to be used, and on the basis of providing various brightness level control, the realization cost is effectively reduced, so that the user experience of a product is improved, and the product value is improved.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.