LED matrix driving method and device
By fixing the scan time of COM in the LED matrix driver and calculating the enable time, the current dynamic distribution of each LED in the LED matrix is realized, which solves the problems of high hardware cost and inconsistent brightness in the existing technology, and achieves uniform LED brightness. improvement in performance and cost-effectiveness.
Patent Information
- Application Number
- CN202410733814.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing LED driving technology, the LED matrix driving method has the problems of high hardware cost and inconsistent brightness. Especially in the LED matrix driving method of common cathode or common anode, the uneven current distribution of COM leads to inconsistent LED brightness.
By fixing the scan time of each COM in the LED matrix driver and calculating the enable time based on the number of LEDs that need to be lit for each COM, the current of each group of lights is dynamically distributed to ensure the average driving current of each LED. consistent.
The scanning duty cycle of each COM is the same, and the current limiting resistor resistance is the same. By controlling the LED enable time per unit time, the average operating current of the LED is the same, so that the brightness of the LED is consistent and the hardware cost is reduced.
Smart Images

Figure CN118612908A
Abstract
Description
Technical Field
[0001] The present application relates to the field of LED driving technology, and in particular to an LED matrix driving method and device. Background Art
[0002] In recent years, light emitting diodes (LEDs) have been widely used in various fields, such as LED lamps, due to their significant energy saving, environmental protection, impact resistance, strong lightning resistance, and long life. While LEDs are widely used, the distribution of LED driving current has become one of the most important issues today.
[0003] At present, the existing technology mainly adopts two methods to realize the distribution of LED driving current. The first LED driving method uses Figure 1 The common anode or common cathode LED matrix shown in the figure can realize the brightness control of the LED lamp by controlling the conduction time of the LED SEG port. However, this LED matrix driving method needs to adapt to the COM and SEG ports, occupying more IO ports of the controller and increasing the hardware cost.
[0004] The second LED driving method is as follows Figure 2 The LED matrix driving method shown in the figure uses three states of the microcontroller pins (output high, output low and high impedance input) to achieve N pins driving N*(N-1) LED lights. Compared with the first driving method, N-1 pins can be reduced. There are two scanning methods for this drive. The first is to scan with a duty cycle of 1 / N*(N-1). The positive end of the LED to be lit is high, the negative end is low, and the other pins are input high impedance. Only one LED is lit per unit time. The larger N is, the shorter the lighting time of a single LED is, and the lower the brightness is. The second scanning method is to scan by grouping LEDs with a common positive or negative pole, which can be divided into N groups and scan at a duty cycle of 1 / N. The positive pole of the LED to be lit is high, the negative pole is low, and the other pins are output high impedance. N-1 LED lights can be lit per unit time, but the LEDs lit in COM per unit time will have different numbers of lights lit per unit time due to the series-parallel relationship of the COM current limiting resistor, resulting in different currents of the LEDs in COM, and thus inconsistent brightness of the LEDs in different COMs. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides an LED matrix driving method and device, which, on the basis of LED drive group scanning, fixes the scanning time of each COM, and selects the enabling time for each COM, thereby allocating an average driving current to each LED, thereby realizing dynamic current distribution for each group of lamps, and the allocation method is low-cost, convenient and flexible.
[0006] In a first aspect of the present application, a LED matrix driving method is provided. The LED matrix driving method is used to distribute current to LEDs in an LED matrix. The LED matrix has N COMs, and the COMs include multiple LEDs. The LED matrix driving method includes:
[0007] Set each COM scan time to be the same;
[0008] Get the number of LEDs M that need to be lit for each COM, where the value range of M is [0≤M≤(N-1)];
[0009] Calculate the enabling time of each COM according to the number M of LEDs that need to be lit on each COM;
[0010] Calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit in each COM;
[0011] Calculate the instantaneous current Current_led flowing through the LED in the current COM according to Current_com;
[0012] Calculate the average current Current_ave_led flowing through the LED in the unit scanning time according to Current_led and the enabling time of each COM;
[0013] COM has three output states, including: high level, low level and high impedance.
[0014] Specifically, the enabling time of each COM is calculated according to the number M of LEDs that each COM needs to light up, which is: the enabling time of each COM=((the number M of LEDs that the current COM needs to light up+1) / the total number of COMs)*unit scanning time.
[0015] Specifically, the instantaneous current Current_com flowing through the current COM is calculated according to the number M of LEDs that need to be lit in each COM:
[0016] Among them, V represents the voltage when COM outputs high level state, R represents the current limiting resistor, and P represents the LED voltage drop in each COM.
[0017] Specifically, the instantaneous current Current_led flowing through the LED in the current COM is calculated based on Current_com as follows:
[0018]
[0019] Specifically, the average current Current_ave_led flowing through the LED in the unit scanning time is calculated according to Current_led and the enabling time of each COM:
[0020]
[0021] In a second aspect of the present application, an LED matrix driving device is provided, the LED matrix driving device is used to distribute current to LEDs in an LED matrix, the LED matrix has N COMs, the COMs include multiple LEDs, and the LED matrix driving device includes:
[0022] The control module is used to set the scanning time of each COM to be the same; obtain the number M of LEDs that need to be lit in each COM, where the value range of M is [0≤M≤(N-1)], calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit in each COM, calculate the instantaneous current Current_led flowing through the LED in the current COM according to Current_com, calculate the enabling time of each COM according to the number M of LEDs that need to be lit in each COM, and calculate the average current Current_ace_led flowing through the LED in the current COM within the unit scanning time according to Current_led and the enabling time of each COM;
[0023] The output module is used to output high level, low level or high impedance state to each COM according to the signal output by the control module.
[0024] Compared with the prior art, the beneficial results of this application are:
[0025] In this proposal, the scanning duty cycle of each COM is the same, the resistance value of the current limiting resistor is the same, and by controlling the enabling time of the LED per unit time, the average working current of the LED is made the same, so that the brightness of the LED is the same. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present application. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0027] Figure 1 It is a schematic diagram of prior art one;
[0028] Figure 2 It is the schematic diagram of the prior art 2;
[0029] Figure 3 is a schematic diagram of an LED matrix driving method according to an embodiment of the present application;
[0030] Figure 4 is a flow chart of an LED matrix driving method according to an embodiment of the present application;
[0031] Figure 5 is a structural schematic diagram of an LED matrix driving device according to an embodiment of the present application;
[0032] Figure 6 It is a schematic diagram of the implementation process of an LED matrix driving method according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In the following detailed description, reference is made to the accompanying drawings, which form a part of the detailed description and are shown by illustrative specific embodiments in which the present application can be practiced. To this end, directional terms, such as "top", "bottom", "left", "right", "up", "down", etc., are used with reference to the orientation of the figures described. Because the components of the embodiments can be positioned in several different orientations, directional terms are used for the purpose of illustration and are by no means limiting. It should be understood that other embodiments may be utilized or logical changes may be made without departing from the scope of the present application. Therefore, the following detailed description should not be adopted in a limiting sense, and the scope of the present application is defined by the appended claims.
[0034] Figure 4 is a flow chart of an LED matrix driving method according to an embodiment of the present application, such as Figure 4 As shown, a LED matrix driving method is used to distribute current to LEDs in an LED matrix, the LED matrix has N COMs, the COMs include multiple LEDs, and the LED matrix driving method includes:
[0035] Set each COM scan time to be the same;
[0036] Get the number of LEDs M that need to be lit for each COM, where the value range of M is [0≤M≤(N-1)];
[0037] Calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit in each COM;
[0038] Calculate the instantaneous current Current_led flowing through the LED in the current COM according to Current_com;
[0039] Calculate the enabling time of each COM according to the number M of LEDs that need to be lit on each COM;
[0040] The average current Current_ave_led flowing through the LED in unit scanning time is calculated based on Current_led and the enable time of each COM.
[0041] Specifically, COM has three output states, including: high level, low level and high impedance.
[0042] Specifically, the enabling time of each COM is calculated according to the number M of LEDs that each COM needs to light up, which is: the enabling time of each COM=(the number M of LEDs that the current COM needs to light up+1)*scanning time.
[0043] Specifically, the instantaneous current Current_com flowing through the current COM is calculated according to the number M of LEDs that need to be lit in each COM:
[0044] Among them, V represents the voltage when the COM port outputs a high level state, R represents the current limiting resistor, and P represents the LED voltage drop in each COM port.
[0045] Specifically, the instantaneous current Current_led flowing through the LED in the current COM is calculated based on Current_com as follows:
[0046]
[0047] Specifically, the average current Current_ave_led flowing through the LED in the unit scanning time is calculated according to Current_led and the enabling time of each COM:
[0048]
[0049] Figure 5 is a schematic structural diagram of an LED matrix driving device according to an embodiment of the present application, such as Figure 5 As shown, an LED matrix driving device is used to distribute current to LEDs in an LED matrix, the LED matrix has N COMs, the COMs include multiple LEDs, and the LED matrix driving device includes:
[0050] A control module, used to set each COM scan time to be the same;
[0051] Get the number M of LEDs that need to be lit for each COM, where the value range of M is [0≤M≤(N-1)], calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit for each COM, calculate the instantaneous current Current_led flowing through the LED in the current COM according to Current_com, calculate the enable time of each COM according to the number M of LEDs that need to be lit for each COM, and calculate the average current Current_ace_led flowing through the LED in the current COM within the unit scan time according to Current_led and the enable time of each COM;
[0052] The output module is used to output a high level, a low level or a high impedance state to each COM port according to the signal output by the control module.
[0053] Figure 6 is a schematic diagram of an implementation flow of an LED matrix driving method according to an embodiment of the present application, such as Figure 6 As shown, obtain the number of COMs N and the number of LEDs M that need to be lit for each COM, calculate and record the enabling time of each COM, and obtain the lighting time of the LED of each COM;
[0054] First, compare the LED lighting time of each COM with the unit scanning time of each COM to determine whether the LED lighting time of each COM is greater than or equal to the unit scanning time of each COM; if the LED lighting time of each COM is less than the unit scanning time of each COM, further determine whether the LED lighting time of the current COM is greater than the enabling time of the current working COM. If the LED lighting time of the previous COM is greater than the enabling time of the current working COM, turn off all the LEDs of the matrix and end; if the LED lighting time of the previous COM is less than or equal to the enabling time of the current working COM, end;
[0055] If the LED lighting time of each COM is greater than or equal to the unit scanning time of each COM, the LED lighting time of the current COM is reset to zero;
[0056] Further, the current COM count is increased by 1 to determine whether the current working COM is greater than N. If so, the COM count is cleared and the next step is executed. If not, the next step is executed directly.
[0057] Turn off all LEDs in the matrix, then light up the LEDs that need to be lit in the current COM and end the current COM operation and count.
[0058] Obviously, those skilled in the art can make various modifications and changes to the embodiments of the present application without departing from the spirit and scope of the present application. In this way, if these modifications and changes are within the scope of the claims of the present application and their equivalents, the present application is also intended to cover these modifications and changes. The word "comprising" does not exclude the presence of other elements or steps not listed in the claims. The simple fact that certain measures are recorded in mutually different dependent claims does not indicate that the combination of these measures cannot be used to profit. Any figure mark in the claims should not be considered to limit the scope.
Claims
1. A LED matrix driving method, characterized in that: The LED matrix driving method is used to distribute current to LEDs in an LED matrix, wherein the LED matrix has N COMs, and the COMs include a plurality of LEDs. The LED matrix driving method includes: Setting the COM scan times to be the same; Obtain the number M of LEDs that need to be lit for each of the COMs, where the value range of M is [0≤M≤(N-1)]; Calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit in each COM; Calculate the instantaneous current Current_led flowing through the LED in the current COM according to the Current_com; Calculate the enabling time of each COM according to the number M of LEDs that need to be lit on each COM; Calculate the average current Current_ave_led flowing through the LED within the unit scanning time according to the Current_led and the enabling time of each of the COMs; The COM has three output states, including: high level, low level and high impedance.
2. The LED matrix driving method according to claim 1, characterized in that: The specific calculation of the enabling time of each COM according to the number M of LEDs required to be lit by each COM is: the enabling time of each COM=((the number M of LEDs required to be lit by the current COM+1) / the total number of COMs)*unit scanning time.
3. The LED matrix driving method according to claim 2, characterized in that: The instantaneous current Current_com flowing through the current COM is calculated according to the number M of LEDs to be lit in each COM as follows: Among them, V represents the voltage when COM outputs high level state, R represents the current limiting resistor, and P represents the LED voltage drop in each COM.
4. The LED matrix driving method according to claim 3, characterized in that: The instantaneous current Current_led flowing through the LED in the current COM is calculated according to the Current_com as follows:
5. The LED matrix driving method according to claim 4, characterized in that: The average current Current_ave_led flowing through the LED in the unit scanning time is calculated according to the Current_led and the enabling time of each COM as follows:
6. An LED matrix driving device, characterized in that: The LED matrix driving device is used to distribute current to LEDs in the LED matrix, the LED matrix has N COMs, the COMs include multiple LEDs, and the LED matrix driving device includes: A control module, used for setting the COM scanning time to be the same; Obtain the number M of LEDs that need to be lit for each COM, where the value range of M is [0≤M≤(N-1)], calculate the enabling time of each COM according to the number M of LEDs that need to be lit for each COM, calculate the instantaneous current Current_com flowing through the current COM according to the number M of LEDs that need to be lit for each COM, calculate the instantaneous current Current_led flowing through the LED in the current COM according to Current_com, and calculate the average current Current_ace_led flowing through the LED in the current COM within a unit scanning time according to Current_led and the enabling time of each COM; The output module is used to output a high level, a low level or a high impedance state to each of the COMs according to the signal output by the control module.
