Addressable LED matrices. We make an LED ticker on Arduino with our own hands. Diagram of LED matrices

After I made the 8x10 matrix, many people contacted me asking me to create a larger matrix and also to allow data to be written to the matrix using a PC. Therefore, one fine day I collected the LEDs that remained after making the LED cube, and decided to make a larger matrix, taking into account the requirements that my colleagues asked me for.

Well, what are you waiting for? Take LEDs and a soldering iron, because together we will now make a 24x6 LED matrix!

Step 1: Gathering Everything You Need

For this project you will need a basic set of tools: a soldering iron, solder, pliers, some wire, wire cutters, a wire stripper, and removal tools if you need them.

To make a matrix you need:
1. 144 LEDs
2. 24 resistors (the value is determined by the type of LEDs, in my case 91 Ohms)
3. Decimal counter 4017
4. 6 resistors with a nominal value of 1 kOhm
5. 6 transistors 2N3904
6. Long breadboard
7. Arduino
8. 3 x 74HC595 shift registers
10.Multiple pin connectors

Step 2: How does it work?

The idea behind how an LED matrix works is as follows: information is usually broken down into small pieces, which are then transmitted one after another. This way you can save a lot of pins on the Arduino and make your program quite simple.

Now it's time to use 3 shift registers that multiply multiple outputs and save a lot of arduino pins.

Every shift register has 8 outputs and you only need 3 arduino pins to control an almost unlimited number of shift registers.

We will also use a 4017 decimal counter to scan the rows. It can scan up to 10 rows because you only have 10 outputs, but you only need 2 outputs to monitor them.

The 4017 is a very useful IC. You can get acquainted with her work in the footnote

As I said earlier, scanning is done using a 4017 decimal counter by connecting one row to ground at a time and sending the data through shift resistors to the columns.

Step 3: Circuit Design

The only elements that I did not include in the diagram are the current limiting resistors, since their value depends on the type of LEDs used. Therefore, you need to calculate their value yourself.

To calculate the values ​​of 24 resistors, follow the following link:.

First you need to look at the LED data sheet to find out the forward voltage and forward current. This information can be obtained from the seller. The circuit operates at a voltage of 5V. Therefore, you need a 5V power supply.

Download original file to study the diagram in more detail (click on the diagram to enlarge the image).

Step 4: Soldering LEDs

Soldering 144 LEDs to create a matrix can be a difficult task if you don't know exactly how to do it.

The last time I soldered a die, I used a lot of wire jumpers, which were very difficult to solder. Therefore, this time I approached this problem more creatively.

You need to bend down the positive lead of the LED towards the other leads and make a row, then cut off the unused part of the lead, and try to make these connections as low as possible. Next, perform this procedure similarly for all positive leads.

Now the negative leads are connected in a column and their soldering is difficult due to the positive row in their path. So you need to bend the negative lead 90 degrees, then bridge over the positive row to the next negative lead and so on for the rest of the LEDs.

I won't explain how to solder shift registers and other components, since everyone has their own style and working methods.

Step 5: Programming the Matrix

Now we have come to the last stage of our project - programming the matrix.

Before this, I already wrote two programs that have a lot in common.

I have added a program that receives a word or sentence from a serial monitor IDE arduino and displays it on a matrix. The program code is quite simple and does not claim to be the best in the world, but it really works. You can write your own code or change mine as you wish.

I have attached the file to excel format so you can create your own signs and symbols.

Here's how it works:

Create the required character pixel by pixel (don't worry, it's very easy) and copy the output line like this - #define (OUTPUT LINE)

I plan to add animation code later when I have more time.

Step 6: The device is ready!

Congratulations! You made a 24x6 matrix yourself and now you can quickly display everything you need on it.

Now you can test the matrix, come up with new programs or improve the interface.

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
Arduino board

Arduino Uno

1 To notepad
U1-U3 Shift register

CD74HC595

3 To notepad
U4 Special logic

CD4017B

1 K561IE8 To notepad
Q1-Q6 Bipolar transistor

2N3904

6 To notepad
Resistor

Time passes unnoticed and seemingly recently purchased equipment is already breaking down. So, having worked their 10,000 hours, the lamps of my monitor (AOC 2216Sa) gave up their life. At first, the backlight did not turn on the first time (after turning on the monitor, the backlight turned off after a few seconds), which was solved by turning the monitor on/off again; over time, the monitor had to be turned off/off 3 times, then 5, then 10, and at some point it could not turn on the backlight, regardless of the number of attempts to turn it on. The lamps brought to the light of day turned out to have blackened edges and were legally thrown into scrap. An attempt to install replacement lamps (new lamps of the appropriate size were purchased) was unsuccessful (the monitor was able to turn on the backlight several times, but quickly went into on-off mode again) and finding out the reasons for what the problem could be in the electronics of the monitor led me to the idea that it will be easier to assemble your own monitor backlight using LEDs than to repair the existing inverter circuit for CCFL lamps, especially since there have already been articles on the Internet showing the fundamental possibility of such a replacement.

Disassembling the monitor

Many articles have already been written on the topic of disassembling a monitor; all monitors are very similar to each other, so in brief:
1. Unscrew the monitor delivery mount and the only bolt at the bottom that holds the back wall of the case


2. At the bottom of the case there are two grooves between the front and back of the case, insert a flat-head screwdriver into one of them and begin to remove the cover from the latches along the entire perimeter of the monitor (simply turning the screwdriver carefully around its axis and thereby lifting the case cover). There is no need to exert excessive effort, but it is difficult to remove the case from the latches only the first time (during the repair I opened it many times, so the latches became much easier to remove over time).
3. We have a view of the installation of the internal metal frame in the front of the case:


We take out the board with the buttons from the latches, take out (in my case) the speaker connector and, bending the two latches at the bottom, take out the inner metal case.
4. On the left you can see 4 wires connecting the backlight lamps. We take them out by squeezing them slightly, because... To prevent it from falling out, the connector is made in the form of a small clothespin. We also remove the wide cable going to the matrix (at the top of the monitor), squeezing its connector on the sides (since the connector has side latches, although this is not obvious at first glance at the connector):


5. Now you need to disassemble the “sandwich” containing the matrix itself and the backlight:


There are latches along the perimeter that can be opened by lightly prying with the same flat screwdriver. First, the metal frame holding the matrix is ​​removed, after which you can unscrew three small bolts (a regular Phillips screwdriver will not work due to their miniature size, you will need a particularly small one) holding the matrix control board and the matrix can be removed (it is best to place the monitor on a hard surface, such as a table covered with the fabric matrix facing down, unscrewing the control board, put it on the table unfolded through the end of the monitor and simply lift the case with the backlight, lifting it vertically up, and the matrix will remain lying on the table. You can cover it with something so that it does not gather dust, and assemble it exactly the opposite way order - i.e. cover the matrix lying on the table with the assembled case with backlight, wrap the cable through the end to the control board and, screwing the control board, carefully lift the assembled unit).
The matrix is ​​obtained separately:


And the backlit block separately:


The backlit unit is disassembled in the same way, only instead of a metal frame, the backlight is held by a plastic frame, which simultaneously positions the plexiglass used to diffuse the backlight light. Most of the latches are located on the sides and are similar to those that held the metal frame of the matrix (they open by prying them off with a flat-head screwdriver), but on the sides there are several latches that open “inward” (you need to press on them with a screwdriver so that the latches go inside the case).
At first I remembered the position of all the parts to be removed, but then it turned out that it would not be possible to assemble them “wrongly” and even if the parts look absolutely symmetrical, the distances between the latches on different sides of the metal frame and the locking protrusions on the sides of the plastic frame holding the backlight will not allow them to be assembled “wrongly” "
That's all - we disassembled the monitor.

LED strip lighting

At first, it was decided to make the backlight from an LED strip with white LEDs 3528 - 120 LEDs per meter. The first thing that turned out to be is that the width of the tape is 9 mm, and the width of the backlight lamps (and the seat for the tape) is 7 mm (in fact, there are backlight lamps of two standards - 9 mm and 7 mm, but in my case they were 7 mm). Therefore, after examining the tape, it was decided to cut 1 mm from each edge of the tape, because this did not affect the conductive paths on the front part of the tape (and on the back, along the entire tape, there are two wide power cores, which will not lose their properties due to a decrease of 1 mm over a backlight length of 475 mm, since the current will be small). No sooner said than done:


Just as neat LED Strip Light trimmed along the entire length (the photo shows an example of what happened before and what happened after trimming).
We will need two strips of 475 mm tape (19 segments of 3 LEDs per strip).
I wanted the monitor backlight to work the same way as the standard one (i.e. it was turned on and off by the monitor controller), but I wanted to adjust the brightness “manually”, as on old CRT monitors, because This is a frequently used function, and I got tired of navigating through on-screen menus pressing several keys every time (on my monitor, the right-left keys do not adjust the monitor modes, but the volume of the built-in speakers, so the modes had to be changed through the menu every time). To do this, I found a manual for my monitor on the Internet (for those who need it, it is attached at the end of the article) and on the page with the Power Board, according to the diagram, +12V, On, Dim and GND were found that are of interest to us.


On - signal from the control board to turn on the backlight (+5V)
Dim - PWM backlight brightness control
+12V turned out to be far from 12, but somewhere around 16V without backlight load and somewhere around 13.67V with load
It was also decided not to make any PWM adjustments to the backlight brightness, but to power the backlight DC(at the same time, the issue is resolved that on some monitors the PWM backlight operates at a not very high frequency and for some this makes the eyes a little more tired). In my monitor, the “native” PWM frequency was 240 Hz.
Further on the board we found contacts to which the On signal is supplied (marked in red) and +12V to the inverter unit (the jumper that must be removed to de-energize the inverter unit is marked in green). (photo can be enlarged to see notes):


The LM2941 linear regulator was used as the basis for the control circuit, mainly because at a current of up to 1A it had a separate On/Off control pin, which was supposed to be used to control the backlight on/off with the On signal from the monitor control board. True, in LM2941 this signal is inverted (that is, there is voltage at the output when the On/Off input is zero potential), so we had to assemble an inverter on one transistor to match the direct On signal from the control board and the inverted input of LM2941. The scheme does not contain any other excesses:


The output voltage for LM2941 is calculated using the formula:

Vout = Vref * (R1+R2)/R1

Where Vref = 1.275V, R1 in the formula corresponds to R1 in the diagram, and R2 in the formula corresponds to a pair of resistors RV1+RV2 in the diagram (two resistors were introduced for smoother brightness adjustment and reducing the range of voltages regulated by the variable resistor RV1).
I took 1kOhm as R1, and the selection of R2 is carried out according to the formula:

R2=R1*(Vout/Vref-1)

The maximum voltage we need for the tape is 13V (I took a little more than the nominal 12V so as not to lose brightness, and the tape will survive such a slight overvoltage). Those. maximum value R2 = 1000*(13/1.275-1) = 9.91 kOhm. The minimum voltage at which the tape still glows at least somehow is about 7 volts, i.e. minimum value R2 = 1000*(7/1.275-1) = 4.49 kOhm. Our R2 consists of a variable resistor RV1 and a multi-turn trimming resistor RV2. The resistance of RV1 is 9.91 kOhm - 4.49 kOhm = 5.42 kOhm (we select the closest value of RV1 - 5.1 kOhm), and RV2 is set to approximately 9.91-5.1 = 4.81 kOhm (in fact, it is best to first assemble the circuit, set the maximum resistance of RV1 and measure the voltage at At the output of LM2941, set the resistance RV2 so that the output has the required maximum voltage (in our case, about 13V).

Installation of LED strip

Since after cutting the tape by 1 mm, the power conductors were exposed at the ends of the tape, I pasted electrical tape (unfortunately, not blue but black) onto the body in the place where the tape would be glued. The tape is glued on top (it is good to warm the surface with a hairdryer, because the tape sticks much better to a warm surface):


Next, the back film, plexiglass and light filters that lay on top of the plexiglass are mounted. Along the edges I supported the tape with pieces of eraser (so that the edges on the tape did not come off):


After that, the backlight unit is assembled in the reverse order, the matrix is ​​installed in place, and the backlight wires are brought out.
The circuit was assembled on a breadboard (due to simplicity, I decided not to wire the board), and was fastened with bolts through holes in the back wall of the metal monitor case:




Power and control signal On were supplied from the power supply board:


The estimated power allocated to the LM2941 is calculated using the formula:

Pd = (Vin-Vout)*Iout +Vin*Ignd

For my case, it is Pd = (13.6-13)*0.7 +13.6*0.006 = 0.5 Watt, so it was decided to make do with the smallest radiator for the LM2941 (placed through a dielectric pad since it is not isolated from the ground in the LM2941).
The final assembly showed that the design was fully functional:


Among the advantages:

  • Uses standard LED strip
  • Simple control board
Disadvantages:
  • Insufficient backlight brightness in bright conditions daylight(the monitor is in front of the window)
  • The LEDs in the strip are not spaced closely enough, so small cones of light from each individual LED are visible near the top and bottom edges of the monitor
  • The white balance is a little off and goes slightly greenish (most likely this can be solved by adjusting the white balance of either the monitor itself or the video card)
Quite a good, simple and budget option for repairing the backlight. It’s quite comfortable to watch movies or use the monitor as a kitchen TV, but it’s probably not suitable for everyday work.

Adjusting brightness using PWM

For those Habro residents who, unlike me, do not remember with nostalgia the analogue brightness and contrast control knobs on the old ones CRT monitors You can make control from the standard PWM generated by the monitor control board without bringing any additional controls outside (without drilling the monitor body). To do this, it is enough to assemble an AND-NOT circuit on two transistors at the On/Off input of the regulator and remove the brightness control at the output (set output voltage constant at 12-13V). Modified scheme:


The resistance of the trimming resistor RV2 for a voltage of 13V should be around 9.9 kOhm (but it is better to set it exactly when the regulator is on)

More dense LED backlight

To solve the problem of insufficient brightness (and at the same time uniformity) of the backlight, it was decided to install more LEDs and more often. Since it turned out that buying LEDs individually is more expensive than buying 1.5 meters of strip and desoldering them from there, a more economical option was chosen (desoldering LEDs from the strip).
The 3528 LEDs themselves are placed on 4 strips 6 mm wide and 238 mm long, 3 LEDs in series in 15 parallel assemblies on each of the 4 strips (the layout of the boards for the LEDs is included). After soldering the LEDs and wires, the following is obtained:




The strips are laid in twos at the top and bottom with wires to the edge of the monitor at the joint in the center:




The nominal voltage on the LEDs is 3.5V (range from 3.2 to 3.8 V), so an assembly of 3 series LEDs should be powered with a voltage of about 10.5V. So the controller parameters need to be recalculated:


The maximum voltage we need for the tape is 10.5V. Those. maximum value R2 = 1000*(10.5/1.275-1) = 7.23 kOhm. The minimum voltage at which the LED assembly still glows at least somehow is about 4.5 volts, i.e. minimum value R2 = 1000*(4.5/1.275-1) = 2.53 kOhm. Our R2 consists of a variable resistor RV1 and a multi-turn trimming resistor RV2. The resistance of RV1 is 7.23 kOhm - 2.53 kOhm = 4.7 kOhm, and RV2 is set to approximately 7.23-4.7 = 2.53 kOhm and adjusted in the assembled circuit to obtain 10.5 V at the output of LM2941 at the maximum resistance of RV1.
One and a half times more LEDs consume 1.2A of current (nominally), so the power dissipation on the LM2941 will be equal to Pd = (13.6-10.5)*1.2 +13.6*0.006 = 3.8 Watt, which already requires a more solid heatsink for heat removal:


We collect, connect, we get much better:


Advantages:
  • Quite high brightness (possibly comparable, and perhaps even superior to the brightness of the old CCTL backlight)
  • The absence of light cones at the edges of the monitor from individual LEDs (LEDs are located quite often and the backlight is uniform)
  • Still simple and cheap board management
Flaws:
  • The issue with the white balance, which goes into greenish tones, has not been resolved
  • LM2941, although with a large heatsink, gets hot and heats everything inside the case

Control board based on step-down regulator

To eliminate the heating problem, it was decided to assemble a brightness controller based on a Step-down voltage regulator (in my case, an LM2576 with a current of up to 3A was chosen). It also has an inverted On/Off control input, so for matching there is the same inverter on one transistor:


Coil L1 affects the efficiency of the converter and should be 100-220 µH for a load current of about 1.2-3A. The output voltage is calculated using the formula:

Vout=Vref*(1+R2/R1)

Where Vref = 1.23V. For a given R1, you can obtain R2 using the formula:

R2=R1*(Vout/Vref-1)

In calculations, R1 is equivalent to R4 in the circuit, and R2 is equivalent to RV1+RV2 in the circuit. In our case, to adjust the voltage in the range from 7.25V to 10.5V, we take R4 = 1.8 kOhm, variable resistor RV1 = 4.7 kOhm and trimming resistor RV2 at 10 kOhm with an initial approximation of 8.8 kOhm (after assembling the circuit, it is best to set its exact value by measuring the voltage at the output of LM2576 at maximum resistance RV1).
I decided to make a board for this regulator (the dimensions did not matter, since there is enough space in the monitor to mount even a large board):


Control board assembly:


After installation in the monitor:


Everyone is here:


After assembly everything seems to work:


Final option:


Advantages:

  • Sufficient brightness
  • Step-down regulator does not heat up and does not warm up the monitor
  • There is no PWM, which means nothing blinks at any frequency
  • Analogue (manual) brightness control
  • No restrictions on minimum brightness (for those who like to work at night)
Flaws:
  • The white balance is slightly shifted towards green tones (but not much)
  • At low brightness (very low), unevenness in the glow of LEDs of different assemblies is visible due to the spread of parameters

Improvement options:

  • White balance is adjustable both in the monitor settings and in the settings of almost any video card
  • You can try installing other LEDs that will not noticeably disrupt the white balance
  • To eliminate the uneven glow of LEDs at low brightness, you can use: a) PWM (adjust the brightness using PWM by always supplying the rated voltage) or b) connect all the LEDs in series and power them with an adjustable current source (if you connect all 180 LEDs in series, you will need 630V and 20mA), then the same current should pass through all the LEDs, and each one will have its own voltage drop; the brightness is regulated by changing the current and not the voltage.
  • If you want to make a PWM-based circuit for LM2576, you can use a NAND circuit at the On/Off input of this Step-down regulator (similar to the above circuit for LM2941), but it is better to put a dimmer in the gap of the negative wire of the LEDs via a logic-level mosfet

You can download from this link:

  • AOC2216Sa Service Manual
  • LM2941 and LM2576 datasheets
  • Regulator circuits for LM2941 in Proteus 7 and PDF format
  • Board layout for LEDs in Sprint Layout 5.0 format
  • Diagram and layout of the regulator board on LM2576 in Proteus 7 and PDF format

LEDs are increasingly taking their place among lighting sources.
Low power consumption and brightness have allowed LEDs to displace traditional incandescent lamps and compete quite confidently with energy-saving lamps.
Succumbing to the general trend, I decided with my own hands touch and look with your own eyes at the LED matrix, which does not require any separate drivers, but connects directly to the 220 volt network. Who is interested? this topic, please under cat.
As a result, I chose the following copy:

From the description on the page it follows that this source Sveta:
- produced using LED SOV technology;
- supply voltage 220 volts;
- power consumption 30 watts;
- color temperature 2500-3200K;
- substrate (base) material aluminum;
- overall dimensions 40*60mm;

While the parcel was traveling, I studied the theory.
What is LED COB technology?

Until about 2009, LED products had only one direction of development - increasing the power of LEDs or Power LEDs. The improvement of this technology has made it possible to achieve the power of one LED at 10 watts.
As it turned out, further increase in power does not make sense due to the high cost of producing a separate powerful LED. An important role in the search for a different path of development was also played by the fact that the LED is a point source of light and it is possible to achieve illumination of a large surface area using powerful LEDs It turned out to be not easy and not very cheap. To obtain more or less acceptable results, it was necessary to use optical systems to diffuse the light.
The next step was to use SMD LEDs to create acceptable diffuse light sources - a large number of LEDs were soldered onto one board. The disadvantages are the overall labor intensity of the process - the production of individual LEDs (each on its own ceramic substrate + personal phosphor layer, etc.). In addition, the disadvantages of the method were the low reliability of individual LEDs and the need for repair if at least one of them fails.
As a result, the engineers came up with the idea of ​​​​the need to produce LEDs without personal attributes and place them on one board on a short distance from each other under a common layer of phosphor, i.e. LED OWL technology. Ultimately, this made it possible to reduce the cost of the light source as a whole and, in the event of failure of individual LEDs, to change the entire module (matrix).

The parcel arrived in a yellow envelope with a bubble wrap inside. The matrix itself is enclosed in a commensurate plastic bag.





As you can see, the LEDs are indeed located close to each other, covered with a common layer of phosphor and protected by a mass resembling plastic glue.
The white substance around the perimeter of the matrix and protecting the driver circuit is similar to rubber or hot melt adhesive - not a hard, elastic mass. This made it possible to remove it from the most prominent cases and determine that one of them is the MB10S diode bridge with maximum constant reverse voltage 1000 volts and a maximum forward current of 0.5 amperes.
Datasheet:

The dimensions correspond to those indicated in the description.



The thickness of the substrate is 1 mm and the weight of the matrix is ​​as much as 8 grams.

It goes without saying that, like high-power LEDs, matrices also need a heatsink. The heatsink from the processor was chosen as such.


The matrix was secured to the radiator using self-tapping screws and thermal paste KPT-8.
An error was made in this sequence of actions - the wire should have been soldered before attaching the matrix to the radiator - the heat from the soldering iron went into the heat sink. The result of soldering is visible in the photo. However, the wires were held securely, and I did not remove the matrix.


The first inclusion made an indelible impression - to say “bright” is to say nothing. Even if viewed from a distance at a slight angle to the plane of the matrix, “hares” are guaranteed. Compared to existing ones energy saving lamps At a temperature of 2800K the light is white and there is a lot of it.

Room of 14 sq. meters is illuminated more than well.







After 20 minutes the temperature rose to 85 degrees. I did not further test the matrix for strength, although the control chips can control the current through the LEDs when they are very hot.

Further tests were carried out using forced cooling using a standard cooler from this radiator and a fan speed control board. The latter was removed from the old PC power supply.





The temperature did not rise above 31.5 degrees for an hour and a half, and the fan operated at low speeds without accelerating.



After which the fan speed control board was removed from the design, and the power supply was replaced with a 9-volt one.

Increasing the voltage in the network made it possible to verify that the declared power consumption corresponds to reality.



As expected, the camera responded to the flickering of the matrix with a frequency of 100 Hertz. I didn’t take a video, but I was able to capture the following:

It would be possible to combat ripples by soldering a capacitor to the diode bridge. This would cause the voltage to increase to 220 * 1.41 = 310.2 volts and it would be necessary to play with the limiting resistors BP5132H, but since I was initially aware that this light source was not for residential premises, I did not start this fight .
The scope of application of the matrix is ​​general lighting of the street, utility rooms, etc., and, therefore, pulsations can be neglected.
With the help of LATR, it was possible to establish (the experiment was carried out at work and I did not take a photo, so as not to answer the questions: “Why?”) that the lower threshold at which the matrix still emits light is 130-odd volts. I didn’t apply more than 250 volts, but in that case a welder’s mask wouldn’t hurt).
Due to the fact that this light source has high power and, so to speak, increased light density, a diffusing screen in front of the matrix would not be out of place.

As a result, the disadvantages include:
- increased heat generation (technological costs, but not design) and the need to use a heat sink (preferable to active cooling);
- quite high cost.

However, these disadvantages are more than offset by the brightness of this matrix, the ability to illuminate a large area, and compliance with the declared characteristics.
I cannot attribute flickering to negative features as much as the area of ​​application of the matrix is ​​NOT residential premises.
Separately, I would like to address the adherents of the Order of “Haters of paragraph 18”). Friends, I ask you to be objective in assessing the information presented in the review, especially since it took quite a lot of effort and time to collect, systematize and present it.

The product was provided for writing a review by the store. The review was published in accordance with clause 18 of the Site Rules.

I'm planning to buy +44 Add to favorites I liked the review +60 +111

Let's start with the types of matrix connections, there are only two of them: serial and parallel, + combined power supply option. The pros and cons are indicated in the figure; for large matrices it is preferable to use the parallel type, this way the power supply is organized much better. But you will have to tinker with the branches of the power wires. If you make a matrix from a garland of modules, then it is naturally easier to make it in a zigzag. But be sure to check at different brightnesses and make sure that there is enough current for the distant LEDs (when the voltage drops, the specified white color turns yellow (small drop) or red (severe voltage drop). In this case, the power will need to be duplicated with thick wires to each piece of tape (to each row of the matrix).

The matrix is ​​connected to the Arduino according to, then the output is extracted from it. Important points:

  • Arduino logic pin connected to pin DIN tape (matrix) through a resistor with a nominal value of 220 Ohms (you can take any in the range of 100 Ohms - 1 kOhm). Needed to protect the Arduino pin from overload, i.e. limit the current in the circuit (see Ohm's law);

  • GND (ground, minus) tape Necessarily connects to the Arduino GND pin even with separate power supply;

  • An electrolytic capacitor for powering the Arduino is needed to filter the sudden voltage drops that the tape creates when changing colors. The capacitor voltage is from 6.3V (the higher, the larger and more expensive the capacitor), the capacitance is around 470 uF, more is possible, less is not recommended. You can do without it at all, but there is a risk of disturbing the stability of work!

  • A capacitor for powering the tape is needed to facilitate the operation of the power supply during sudden changes in the brightness of the matrix. Yet again You can do without it at all, but there is a risk of disruption to work stability!

  • The power (and maximum output current) of the power supply is selected based on the size of the matrix and the modes in which it will operate. See the sign and remember Chinese amperes, i.e. The power supply must be taken with a current reserve of 10-20%! The table shows the values current consumption of the tape.

  • In the firmware GuyverMatrixOS version 1.2 and higher, the system current limitation is configured. How it works: in the sketch settings there is a parameter CURRENT_LIMIT, which sets the maximum current consumption of the matrix in milliamps. Arduino will make a calculation based on the colors and brightness of the LEDs and automatically reduce the brightness of the entire matrix to prevent exceeding the established current limit in especially “guzzling” modes. This is a very cool feature!

ASSEMBLY OF THE CASE AND DIFFUSER

FIRMWARE AND SETTINGS

The first thing you need to do is configure it in the sketch matrix dimensions, connection point And direction of the first segment tapes. Hint below.

This type of matrix initialization allows you to connect a matrix of any configuration with any position of the beginning of the matrix. This is convenient for purchased matrices, which can only be “twisted,” and for homemade ones, when there are some peculiarities of the case or wiring. That is, no matter how you make or position the matrix, it will still work with the correct position of the origin. By the way, you can very easily “mirror” the matrix horizontally or vertically, if this is suddenly needed for some reason: just change the connection to the “opposite” one along the desired axis. For example, we want to mirror the connection type (1, 0) vertically. We configure it as (2, 2) - see the figure above. If we want to mirror the type (3, 1) vertically, we set it up as (2, 3). Type (3, 2) horizontally? Please put it as (2, 2). I hope the logic is clear.

If you're new to Arduino, stop and learn. After installing the drivers and libraries, you can proceed to flashing the platform firmware. I have a ready-made project with games and effects, go for details and firmware. Next there will be information for developers, that is, those who want to write something for the matrix themselves!

At the very beginning of the firmware there are settings for the type of matrix and its connection; the type of connection is determined by standing facing the matrix. To simplify the setup of the matrix connection (angle and direction), use the hint above =)

// **************** MATRIX SETTINGS **************** #define LED_PIN 6 // tape pin #define BRIGHTNESS 60 // standard maximum brightness (0-255) #define WIDTH 16 // matrix width #define HEIGHT 16 // matrix height #define MATRIX_TYPE 0 // matrix type: 0 - zigzag, 1 - sequential #define CONNECTION_ANGLE 0 // connection angle: 0 - bottom left, 1 - top left, 2 - top right, 3 - bottom right #define STRIP_DIRECTION 0 // tape direction from the corner: 0 - right, 1 - up, 2 - left, 3 - down

The firmware also contains a tab utility_funx, which contains all the functions for working with the matrix:

Void loadImage(bitmap array name); // display an image from the "array name" array. For the pictures, read below void drawDigit3x5(byte digit, byte X, byte Y, uint32_t color); // draw a number (digit, X coordinate, Y coordinate, color) void drawDots(byte X, byte Y, uint32_t color); // draw points for the clock (X coordinate, Y coordinate, color) void drawClock(byte hrs, byte mins, boolean dots, byte X, byte Y, uint32_t color1, uint32_t color2); // draw a clock (hours, minutes, on/off points, X coordinate, Y coordinate, color1, color2) static uint32_t expandColor(uint16_t color); // convert color from 16 bit to 24 bit uint32_t gammaCorrection(uint32_t color); // gamma correction (converts the color to a more natural color) void fillAll(uint32_t color); // fill the entire matrix with color void drawPixelXY(byte x, byte y, uint32_t color); // function for drawing a point by X Y coordinates (X coordinate, Y coordinate, color) uint32_t getPixColor(int thisPixel); // function for getting the color of a pixel by its number uint32_t getPixColorXY(byte x, byte y); // function for getting the color of a pixel in the matrix by its coordinates (X coordinate, Y coordinate) uint16_t getPixelNumber(byte x, byte y); // get the pixel number in the feed by coordinates (X coordinate, Y coordinate, color)

The origin of the matrix coordinates is the lower left corner, has zero coordinates!

Using these functions you can create various effects of varying degrees of complexity, as well as classic games!

IN last years LED matrices are widely used in outdoor advertising and various information boards. Quite bright and dynamic - they attract attention perfectly and do not go blind on a sunny day. Each of you sees them on the streets of your city every day.
Of course, their spread was facilitated by low price(due to Chinese manufacturers) and ease of screen assembly.

But what if you try to use similar matrices in your microcontroller devices? What exchange interface and output logic do these matrices have?
Let's try to figure this all out.

The Chinese offer both the matrices themselves in different sizes and with different resolutions, as well as controllers for displaying images with various simple effects, as well as all the necessary accessories, connecting cables, frames.
Matrices are available in both single-color (white, yellow, red, green, blue) and 3-color (RGB). The designation of the matrix model usually looks like this Pxx or PHxx, where xx is a number indicating the distance between the pixels in millimeters. In my case it is P10. In addition, matrices of some standard sizes are not only rectangular, but also square.

Possible options for matrix sizes



So, we have a white matrix of 32x16 pixels with dimensions of 320x160mm and, accordingly, an interpixel distance of 10 mm. Let's take a closer look at it.
Front view:

Did you also think that the LEDs were somehow oval? Didn't you think...


There is a small canopy over the LEDs that prevents sunlight from shining on the LEDs.

Front view with plastic mask removed



We turn the matrix over and see the board:


There are a bunch of logic chips on the board. Let's figure out what kind of microcircuits these are:
1. 1 x SM74HC245D - non-inverting buffer
2. 1 x SM74HC04 - 6 channel inverter
3. 1 x SM74HC138D - 8-bit decoder
4. 4 x APM4953 - assembly of 2 P-channel MOSFETs
5. 16 x 74HC595D - latch shift register
Two 16-pin connectors are interface connectors, one of them is input (the screen controller is connected to it), and the second is output (the next matrix in the chain is connected to it). The arrow on the board is directed from the input connector to the output connector.
Power is supplied to terminals in the center of the board. Supply voltage - 5V, maximum current (when all LED matrices are turned on) - 2A (for a white matrix).

All the information presented above, as well as a demonstration of the matrix in the video below. In it, from 13:04 to 15:00, I talk about the dependence of screen brightness on the number of matrices. This is due to an error in the algorithm. The bug has been fixed and now the data is loaded before the screen turns off.

I will also be glad to see you at my youtube channel, where I connect a lot of other stuff to microcontrollers.

Thank you all for your attention!