Introduction: Simple Arduino 5x2 LED Matrix

Picture of Simple Arduino 5x2 LED Matrix

This is my First Arduino project so bear with me. 
This a simple LED Matrix that is run by an Arduino Uno 3.
You will need these parts:

-10 LEDs
-Arduino Board
-Breadbord
-Jumper Wires
-And some solid core wire


Step 1: LED Placement

Picture of LED Placement

Place the LEDs across the middle of the breadboard one LED row on one side and one LED row on the other.
Place the LEDs so that each pin is in a different row on the breadboard. 

Step 2: Grounding the LEDs

Picture of Grounding the LEDs

Then take small bits of the solid core wire and pin them down one the row in which each cathode is in. Take the other end and put it in one of the power slots. When you are done connecting all of the LEDs cathodes to the power slot connect the the two power slots with one long peice of wire.let yet another piece of wire connect to your Arduino.

Step 3: The Positive Leads.

Picture of The Positive Leads.

Instead of just putting a jumper cable into the same row as the LED's anodes, I lead some wire out away from the LEDs on the breadboard so that I could attach the jumper wires to them. Away from the LEDs so that it would look better. This improved my project a lot I think.

Step 4: Coding

I was lazy when coding and just modified the "Blink" sketch to fit my matrix.
Here is the code

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led1 = 2;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;
int led6 = 7;
int led7 = 8;
int led8 = 9;
int led9 = 10;
int led10 = 11;
int brightness = 0;  
int fadeAmount = 5;


// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
pinMode(led9, OUTPUT);
pinMode(led10, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(75);               // wait for a second
digitalWrite(led1, LOW);
delay(75);// turn the LED off by making the voltage LOWdelay(100);
digitalWrite(led10, HIGH);
delay (75);
digitalWrite(led10, LOW);
delay(75);
digitalWrite(led1, HIGH);
delay (75);
digitalWrite(led1, LOW);
delay(75);
digitalWrite(led2, HIGH);
delay (75);
digitalWrite(led2, LOW);
delay(75);
digitalWrite(led3, HIGH);
delay (75);
digitalWrite(led3, LOW);
delay(75);
digitalWrite(led6, HIGH);
delay (75);
digitalWrite(led6, LOW);
delay(75);
digitalWrite(led9, HIGH);
delay (75);
digitalWrite(led9, LOW);
delay(75);
digitalWrite(led8, HIGH);
delay (75);
digitalWrite(led8, LOW);
delay(75);
digitalWrite(led10, HIGH);
delay (75);
digitalWrite(led10, LOW);
delay(75);
digitalWrite(led7, HIGH);
delay (75);
digitalWrite(led7, LOW);
delay(75);
digitalWrite(led1, HIGH);
delay (75);
digitalWrite(led1, LOW);
delay(75);
digitalWrite(led5, HIGH);
delay (75);
digitalWrite(led5, LOW);
delay(75);
digitalWrite(led2, HIGH);
delay (75);
digitalWrite(led2, LOW);
delay(75);
digitalWrite(led9, HIGH);
delay (75);
digitalWrite(led9, LOW);
delay(75);
digitalWrite(led7, HIGH);
delay (75);
digitalWrite(led7, LOW);
delay(75);
digitalWrite(led6, HIGH);
delay (75);
digitalWrite(led6, LOW);
delay(75);
digitalWrite(led3, HIGH);
delay (75);
digitalWrite(led3, LOW);
delay(100);
digitalWrite(led8, HIGH);
delay (75);
digitalWrite(led8, LOW);
delay(75);
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, HIGH);
digitalWrite(led9, HIGH);
digitalWrite(led10, HIGH);
delay(150);

analogWrite(led1, brightness);
analogWrite(led2, brightness);
analogWrite(led3, brightness);
analogWrite(led4, brightness);
analogWrite(led5, brightness);
analogWrite(led6, brightness);
analogWrite(led7, brightness);
analogWrite(led8, brightness);
analogWrite(led9, brightness);
analogWrite(led10, brightness);

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness == 0 || brightness == 255) {
    fadeAmount = -fadeAmount ;
  }    
  // wait for 30 milliseconds to see the dimming effect   
  delay(30);                           
}

Step 5: Hook Up the Arduino Board and Have Fun!

Picture of Hook Up the Arduino Board and Have Fun!

Upload the code to your Arduino, plug up the matrix and enjoy the show!
You can modify the code all you wish to get personal effects.

Comments

mangopeach (author)2013-04-23

Thanks man. Was a good tutorial. Had a good time doing it.

quatch (author)2013-02-04

You should use some current limiting resistors there. You're lucky in that white LEDs have a high Vf (forward voltage drop) and thus don't need a large resistor to keep the current low.

http://en.wikipedia.org/wiki/LED_circuit

http://led.linear1.org/led.wiz

jackjackboom (author)quatch2013-02-05

dont know why they are showing up blue... Odd. I was using my old iphone 3g for pictures so that explains the low quality.

jackjackboom (author)quatch2013-02-05

I am actually using green ones and I have done some simple led things before without burning out any leds before. Although you are quite right. Just didn't have any layin around..

About This Instructable

8,663views

13favorites

License:

Bio: Hey guys it has been awhile but I am preparing for a new wave of instructables following a partnership with Banggood.com! They have a ... More »
More by jackjackboom:Custom Arduino Micro Quadcopter ConceptSimple Arduino 5x2 LED MatrixiTunes 11 in iTunes 10!
Add instructable to: