Using 8 by 8 led matrix with 74hc595

I have a 8 by 8 led matrix and i want to control it compromising as few of my GPIO pins as possible. For this purpose I have a shift register 74hc595 but NOT the max7219 simply because I cannot buy it right now.

Can anybody tell me how best to do this or if this is even possible to do without burning my board.
I use arduino UNO board.

Also, do I have to add any resistors or so and if so then how much.

Hi,
Have you looked at the MAX7219, it is a single chip that is ideal for 8x8 LED array.

Google
arduino led matrix driver

This link to Adafruit shows you how to use it.

It uses SPI interface so a minimum of control wires.

Tom... :slight_smile:

Well, you could do it with two of those 74hc595 chips, one for the rows and one for the columns, and a sketch with can multiplex.
You would need 8 current limiting resistors (say 220R).

Incidentally, do not edit an earlier post with additional detail which makes any existing replies to it look out of place.

How many leds do you want to appear ON at the same time and how bright should they be?

6v6gt:
You would need 8 current limiting resistors (say 220R).

No, let's not say 220R. :roll_eyes:

Because one pin of the other chip will be required to sink the current from a whole row (or column), the resistors need to be more like eight times that, so 1k5.

GoForSmoke:
How many LEDs do you want to appear ON at the same time and how bright should they be?

If brightness was a concern, or using this for any form of serious project, the answer is - go buy the MAX7219 (or more correctly, the ready-assembled module). :astonished:

Paul__B:
No, let's not say 220R. :roll_eyes:

Because one pin of the other chip will be required to sink the current from a whole row (or column), the resistors need to be more like eight times that, so 1k5.
. . .

OK. But that depends on his multiplexing strategy. If for example if, at any moment, only one led is lit, then 220R would be right. The penalty is dimmer display, but the OP's priorities are, as far as I can see, to avoid ordering something new, or has specifically ruled out buying a max7219 based solution.

Of course, I agree that a specific led driver chip, of which the Max7219 is only one example, would be the solution I would prefer.

6v6gt:
OK. But that depends on his multiplexing strategy. If for example if, at any moment, only one led is lit, then 220R would be right.

Which would mean a 1 in 64 multiplex for full illumination of the matrix! :astonished:

Hi,
Google

arduino 74hc595 8x8 led matrix

It is surprising what google can do for you!!!!!

Tom.... :slight_smile:

Since I used WS2811 and WS2812 I look at other many-led solutions as too much work using too many pins.

WS led strips and strings get cheap per pixel, WS2811 look like tree light strings (12mm glowing bulbs) with wires you can splice. A string of 50 runs about $15, you would need 2 and have enough bulbs to do 10x10 --- and need a few amps 5V supply.

The whole string takes 1 IO pin to run and you can pick what color and brightness to make any of the leds as long as there's power for them all.

You can use 74HC595 to source current into the anodes, but you should use TPIC6C595 or TPIC6B595 to sink current from the common cathodes. Turning on all 8 rows would be ~64mA from the HC595, you need to 6C595 sink sink all that current from the column that is on.
0.1uF cap for each shift register, and then 270 ohm resistors for current limiting on the HC595 pins.

Can you spring $2 (USD) for a MAX7219?

Need a 0.1uF cap, a 10uF cap, and a 10K resistor as well. 15 levels of brightness control (for the whole display).

Then after setting up 5 registers, it's a simple matter to write to 1 of 8 registers to update the output.
The MAX7219 takes cares of muxing the output at 800 Hz for you, nice & smooth.

digitalWrite (ssPin, LOW);
SPI.transfer(registerAddress); // 1 to 8
SPI.transfer(dataToDisplay);
digitalWrite (ssPin, HIGH);

Default settings of SPI.begin(); of MSBFIRST, 4 MHz SPI clock, SPI Mode 0 work just fine.

Can even find 3 for $5 on amazon, or 3 boards with MAX7219 and a display for $8.50 ($2.85).

I’m not saying it is the case here, but that would make quite a good school exercise.

You have these components (as in OP). Aim for minimum gpio pin usage and maximum consistent brightness of the display, respecting any maximum limits in the respective data sheets. The solution will ensure that, at any instant, no more the permitted number of leds are on.

Any attempt by the student to present the problem in an Internet forum would be hopelessly frustrated by numerous alternative solutions outside the scope of the exercise.