r/ArduinoHelp • • Jul 12 '26

Having trouble with led arrays/multiplexing

As title says, I’m having trouble wrapping my head around multiplexing leans for use with a microcontroller with not enough pins to control them all. Using the drivers makes sense, mosfets too, but the code escapes me? And the use of resistors within the circuit is also confusing to me. Trying to make a small led “screen” made of diodes. Any help is appreciated

2 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/gm310509 Jul 12 '26

First off, my apologies, I created the circuit differently to what I described in my first step. I have corrected the project to use just the one resistor as I've described, so you should have a look at it again.

To cover the questions, You need one resistor for each individual LED that is being lit up.

In my second step, I said that you should replace the 5V line with a GPIO line (row) and you place the image or LED setting that you want to display on that line - this determines which row you want to light up. A row is light up by placing a HIGH onto that GPIO pin.

Next, you need to choose which column you want to enable. This is what my "step one" project is doing, it is selecting one of the four columns in a strobing manner. But because it is strobing quickly, all four LEDs look like they are lit. If you change the delay as I suggested, you will see the strobing effect as the one LED strobes across the four LEDs.

So, to create a display, you need to add more rows. Rather than connecting them to the "always on" 5V, you connect them to a GPIO pin through which you control whether an LED (row) is on or not. and you select the column as per the example. This means you can control each and every one of the LEDs in your matrix and thus control what is displayed.

As for the resistors, you select a column (by setting it LOW) and thus enable all of the LEDs in that column. Therefore, to meet the "one resistor per active LED" rule, you need to connect them to the rows.