Go Down

Topic: How to make a 9x9 RGB LED Matrix (Read 2 times) previous topic - next topic

ricadam

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.

CrossRoads

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:

Code: [Select]

#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
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

ricadam

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

CrossRoads

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.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up