# Do-It-Yourself Easy 4x6 LED Matrix, Arduino! - do it yourself

In this inst'able, I will show you how to create your very own 4x6
LED matrix as well as show you how to write code for it!

There is an animation creator program in step 4!

Here is one ANIMATION to get you excited about the project!
***Wave Animation***

================================================================|
Hello everyone! I'm back with an all new Inst'able!

This Inst'able is for the electronic enthusiast/hobbyists that has basic
knowledge of the simple hardware used, and a good grasp of the
arduino programming language!

Email me at "JensenR30@GMail.com" if you have any questions about
the instructable.
Post Videos of your own LED Matrices!

FOLLOW ME FOR MORE GREAT INSTRUCTABLES!!

================================================================|

## Step 1: Hardware

For this project you will need:
• An arduino board;
• Twenty-four LEDs of the same color;
• Four transistors;
• Four 100ohm resistors;
• Four 1Kohm resistors;
• And a fair amount of wire.

• "C" stands for Column while "R" stands for Row.
Columns are vertical, varying the Y axis
Rows are horizontal, varying the X axis.

Click Here for a bigger and better res. view of the above schematic

How The Hardware Works:
The hardware works by applying +5 volts to the desired column and row, and having GND wired to the arduino's GND pin. If I apply +5v only to C1, there will be +5v ready to be passed through all of the LEDs in column 1, but still has to go through the transistors in order to get to GND and there are no LEDs on.. On the other hand, if I apply +5v only to R1, that transistor will allow current to pass from any LED in row 1 to GND. But since there is no voltage applied to any of the columns, no LED is turned on.
From what I have said thus far, we can see that +5v must be applied to a Column and a Row at the same time for any LED to be turned on. Here is where we run into a problem: the only way to turn on 3 LEDs [(C1, R2), (C1, R1), and (C2, R1,) which are the three lowest and to the left] is to apply +5v to pins R2, R1, C1, and C2. The problem with this is that it will also turn on LED (C2, R2)! See step 2 for how to solve this problem, read on for the technical specs!

Technical stuff...
Schematic Pin Name-----------Digital Arduino Pin They Connect To
C1......................................9
C2......................................8
C3......................................7
C4......................................6
C5......................................5
C6......................................4

R1......................................10
R2......................................11
R3......................................12
R4......................................13

GND...................................GDN Well, duh! = )
================================================================|

## Step 2: Persistence Of Vision! (POV)

In step 1--the hardware step--we couldn't turn on more than one LED. How do we fix this?
The answer to this question lies in our wonderful eyes, and their insistence in persistence.
When lights blink very rapidly, our eyes perceive them as being consistently on. We can use this to our advantage when creating animations. To see how the Matrix uses this, see step 4.

The Animation Creator file included in STEP 4 and is designed to blink each row really fast and can be used by the novice animator to achieve fame and fortune! ok, well, maybe not. but still!

## Step 3: Lights, Camera, Lights!

In the above photo are a few snapshots of the Matrix in action!
These are come of the animations I have made.
the animation creator that I created for the Matrix!
you will find all of the programs you will need in step 4.

## Step 4: Animation Creator!

Attached are some various animations as well as my Animation Creator for all of your matrix animation creating needs!

How the Animation Creator Works:

The program layout:

--The program first shuts off all of the pins, sets all of the pin variables to 0, and adds 1 to each cycle variable.
--Then we have the portion of the program where we specify which LEDs get turned on, and when they get turned on.
--The cy, cy2, and cy3 variables are very useful in that they increase in one with each cycle of the loop. This allows us to create our POV

if (cy > 1000){
ro = 3;
co3 = 1;
}

if (cy < 1000){
ro = 2;
co2 = 1;
}
=-=This means that if the "cy" variable is less than 1000, LED (C3, R3) gets turned on. In addition, if the "cy" variable is greater than 1000, LED (C2, R2) gets turned on. Remember that upon each cycle, the ro and co1-co6 get reset to 0, as well as the digital pins reset to a LOW state. So the arduino does NOT turn one then the other on, in fact switched from LED (C3, R3) to (C2, R2).

=-=The next step is to turn this information into electrical signals going out to our matrix. If co1=1, C1 is turned HIGH. likewise, if co5=1, C5 is turned HIGH. if ro=1, R1 is turned HIGH, and if ro=4, R4 is turned HIGH.

And that is the basic information that I you need to create your very own animations!
The Animation Creator attached has a clearly labeled section that instructs you where to put you own animation data!

Animation_Creator.pde4 KB
Diagonal_Wave.pde5 KB
Drunken_Wall_Bouncer.pde5 KB
Traveler.pde4 KB
smiley.pde1 KB
Accelerating___Decelerating_Random_LED.pde1 KB
Traveler.pde4 KB

## Step 5: Contact and Ideas

Email me at "JensenR30@GMail.com" if you have any questions about
the instructable, or if you'd like to
share with me a program of your own! Don't be shy! =D