# How to make a 9x9 RGB LED Matrix

Hi all,

I was just wondering what is the easiest was to go about making a RGB LED matrix of 9x9?

Thanks

There must be plenty of examples, I haven't done it so hopefully someone else will chip in but one question, why 9x9 when 8x8 would probably be a lot easier.

Rob

8x8 would be easier but this project requires a 9x9 grid. I was hoping to just output a string of binary and have the respective less turn on.

What do you have for an arduino? That will partially drive the answer you get back.

9x9 RGB is really 9 x 27, yes?

So you could have 27 outputs that the arduino drives directly (thru current limit resistors) into RGB Anodes,
and then 9 transistors sinking the common cathodes from each row (up to 27 * 20mA = 540mA).
If you don’t have a Mega with 36 IO pins for that, than a few shift registers could be used instead.

Here’s the start of such a thing.

I think you are confusing the word matrix, it has two meanings here:- 1) the physical layout of LEDs into a grid. 2) the way a bunch of LEDs is wired up involving multiplexing to drive them.

I am not sure what one you want. Your comment about a bunch of bits implies it is 1) In which case look at the shiftPWM libarie and use a bunch of shift registers.

I would like to have a grid of LEDs and a way to control individual LEDs to create patters, I guess similar to some LEDs cube that I see on youtube. I am using the Arduino Uno. I'm trying to keeps costs to a minimum, so any way to limit the amount of components would be great.

Thank you for your suggestions so far, im very new to all this.

Here’s the start of a 9x9 RGB LED array.
You need 27 Anode drivers, and 9 cathode drivers.
It gives you the start of how things get hooked up.
To drive it, you will drive all the anodes for column1, then drive a cathode low for a bit, then high.
Drive the anodes for the next column, drive that cathode low, then back high.

The data to be read out can be stored in an array, transferred to the array similar to this:

``````#include <SPI.h>

/* 9 high x 10 across array */  << adjust for 27 high by 9 across: more shift registers, 27 bits in a 32-bit long word (data type unsigned long)
/* turn on 1 LED */
#include <SPI.h>
byte latchPin = 10;
byte clockPin = 13;
byte dataPin = 11;
byte clock = 9;
byte Reset = 8;
byte x;
int rowByte;
byte upperrowByte;
byte lowerrowByte;
int columnByte;
// define the LEDs to be turned on. Assuming 1 = on, flip over of 1 = off
// need 10 defined as will be calling out displayArray[0] thru displayArray[9] in the loop
int displayArray [] = {
B00000001,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000};

void setup(){
Serial.begin(9600);
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
pinMode(latchPin,OUTPUT);
pinMode(clock,OUTPUT);
pinMode(Reset,OUTPUT);
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
SPI.begin();
}

void loop() {

for (x = 0; x<10; x=x+1){
digitalWrite (latchPin, LOW);
SPI.transfer (highByte (displayArray[x]) );
SPI.transfer (lowByte (displayArray[x]) );
digitalWrite (latchPin, HIGH);
delay (25);
digitalWrite (clock, HIGH);
digitalWrite (clock, LOW);
}
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
}// end void loop
``````

Im sorry what type of drivers are they, what are the model numbers?

The design came from here http://www.instructables.com/id/Make-a-24X6-LED-matrix/step3/Schematics/ and this thread http://arduino.cc/forum/index.php/topic,100867.0.html

Looks like 74HC595 shift register, 4017 as 1 of 10 selector, and 2n3904 transistors.