3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

9*9 LED matrix with Arduino

9*9 LED matrix with Arduino
Ever wanted to have a bigger display?

This display is based on an 9*9 green LED Matrix. The display is driven just with one Arduino board (Duemilanove in my case).

Why do we use a matrix and we don't light's up the leds individually?

Basic :
A led have 2 pin's: anode & cathode.
So even we put the led's with the common cathode, we will still have 81+1 pin's, the arduino board isn't enought for this.

In a matrix we can put the columns to the cathode and the rows to the anode of the Led's, so here we will have just 9+9 pin's, better then the other but a little tricky on the programming stuff.

 
Remove these adsRemove these ads by Signing Up
 

Step 1Basics

Basics
 What do you need : 

- 81 green LED's (or other color)
- an test PCB
- and an arduino board

next we need the schematics : 

Matrix hardware

I have build the matrix like next :
- the columns have the cathode's of the LED's
- the rows have the anode of the LED's

Arduino Pin's :

Now we will have to connect the matrix to the arduino board :

the rows :
 
- the row 1 to digital pin 0
- the row 2 to digital pin 1
- the row 3 to digital pin 2
- the row 4 to digital pin 3
- the row 5 to digital pin 4
- the row 6 to digital pin 5
- the row 7 to digital pin 6
- the row 8 to digital pin 7
- the row 9 to digital pin 8 

the columns :
- the column 1 to digital pin 9
- the column 2 to digital pin 10
- the column 3 to digital pin 11
- the column 4 to digital pin 12
- the column 5 to analog input pin 0 (there is no problem we can use it like a digital one, i'll show you later)
- the column 6 to analog input 1
- the column 7 to analog input 2
- the column 8 to analog input 3
- the column 9 to analog input 4
« Previous StepDownload PDFView All StepsNext Step »
37 comments
Dec 23, 2011. 11:08 AMCairParavel314 says:
Can you show me a more detailed example of how soldering the LED in the board? I want to do the matrix, but I can't see much from the image and I'm starting with the Arduino also.
Jun 22, 2011. 3:38 PMaxeman911 says:
there still seems to be something wrong with your program about the while statement?
Jun 23, 2011. 9:08 AMaxeman911 says:
yeah i figured that out, now when i upload it, it doesnt light up anything, even though the rows and columns are all in the proper pins.
Jun 23, 2011. 12:28 PMaxeman911 says:
thanx, i will try that
Jun 23, 2011. 1:53 PMaxeman911 says:
so here is my program that turns on one led it works, so what is the next step, but when i define the columns 5, 6, 7, 8, and 9 and put them as ouputs to the analog pin, then nothing blinks???

#define R1 0 //digital pin C stands for colums
#define R2 1 //digital pin R stands for rows
#define R3 2 //digital pin
#define R4 3 //digital pin
#define R5 4 //digital pin
#define R6 5 //digital pin
#define R7 6 //digital pin
#define R8 7 //digital pin
#define R9 8 //digital pin
#define C1 9 //digital pin
#define C2 10 //digital pin
#define C3 11 //digital pin
#define C4 12 //digital pin

void setup() {
pinMode(R1, OUTPUT);
pinMode(R2, OUTPUT);
pinMode(R3, OUTPUT);
pinMode(R4, OUTPUT);
pinMode(R5, OUTPUT);
pinMode(R6, OUTPUT);
pinMode(R7, OUTPUT);
pinMode(R8, OUTPUT);
pinMode(R9, OUTPUT);
pinMode(C1, OUTPUT);
pinMode(C2, OUTPUT);
pinMode(C3, OUTPUT);
pinMode(C4, OUTPUT);
}

void loop() {
digitalWrite(R1, LOW); //here all the way till the first delay
digitalWrite(R2, LOW); //i set the anodes and cothodes opposite
digitalWrite(R3, LOW); //so that they are all off
digitalWrite(R4, LOW);
digitalWrite(R5, LOW);
digitalWrite(R6, LOW);
digitalWrite(R7, LOW);
digitalWrite(R8, LOW);
digitalWrite(R9, LOW);
digitalWrite(C1, HIGH);
digitalWrite(C2, HIGH);
digitalWrite(C3, HIGH);
digitalWrite(C4, HIGH);
delay(500);
digitalWrite(R6, HIGH);
digitalWrite(C1, LOW);
delay(1000);
}
Jun 16, 2011. 10:59 AMaxeman911 says:
there is something wrong with ur program a copyied it and ran it but there is some problem with the while(1){} command?
Jun 17, 2011. 9:17 AMaxeman911 says:
well every time i try to compile or upload it it says that before the while(1) { command a , or ; is expected but i can't find where?
May 25, 2011. 6:19 PMaxeman911 says:
like other matrixes in this one is it possible to make the leds light so that you can make words actually fly across the screen and the same for letters
May 24, 2011. 6:02 PMaxeman911 says:
if the input voltage is 5v don't you need a resistor for the leds?
May 25, 2011. 12:03 PMaxeman911 says:
and what if i leave the leds on for longer.
May 25, 2011. 12:01 PMaxeman911 says:
srry but if u plug in the usb cable it is 5v.
but would it still work if i put a resistor
May 25, 2011. 2:04 PMaxeman911 says:
thanx but what if i want to turn on an entire colum or row on at a time to spell words?

so ur saying that the voltage that comes out of the pins is less then 5V?
May 25, 2011. 6:42 PMaxeman911 says:
srry last one i swear so if i am using the 5v ones i need a resistor
May 25, 2011. 8:34 PMaxeman911 says:
thank you soooo much!!! :)
May 8, 2011. 3:37 AMcrusy says:
from what I read the Arduino can provide 40 mA per pin (http://arduino.cc/en/Main/ArduinoBoardUnoSMD) - isn't this a problem when you turn on all 9 (or even 10) LEDs?
Oct 13, 2010. 12:13 PMpbriz says:
I'm pretty new to this (physical computing) but i'm trying out this project. So far its all good, and makes perfect sense but i noticed that other charlieplexed LED matrixes that I've seen out there tend to include resistors between the LEDs and the power sources (the output pins). Is there a reason why this project doesn't include resistors? Are they used as some sort of precaution normally?

By the way, thanks for this post, its been very helpful!
Oct 7, 2010. 1:54 PMMario1 says:
Whats up with most of your LEDs not lighting?
Is this caused by an LED itself or you messed up the soldering?
Jan 9, 2010. 10:05 AMGOwin says:
CAn you use the original Arduino serial for this? Can the ATMega8 handle this?
Nov 21, 2009. 8:24 PMwinkman says:
 I did this for a project a while ago, because  saw a description etc on the Arduino website. Worked well :)
Nov 18, 2009. 10:47 AMjust_watching says:
you could also use the arduino mega or a clone of it then u can drive even more leds

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
1
Author:zmolroc