Go Down

Topic: 5x7 LED Matrix Issue (Read 4693 times) previous topic - next topic

Hello!

I am fairly new to the Arduino community so I apologize if this question seems obvious..

I bought a 5x7 Led Matrix from the store where they told me it was the anode version. I have tried to get it working but all i get are results of the board flashing or turning on all the LEDs and never the specific chosen ones. I have followed ALL 4 tutorials I could find online but all warrant the same result.

Please help me :)

LED MATRIX MODEL:    TC20-11EWA

Grumpy_Mike

Quote
I have followed ALL 4 tutorials I could find online but all warrant the same result.

Sadly we do not have access to your computer and so have no idea what these tutorials are that you have followed.

Also we don't know how you have wired it up. If like the tutorial then we would need a picture.

There are a lot of rubbish tutorials out there, some don't even use resistors, they can damage your arduino.

http://www.local-guru.net/blog/2009/04/03/5x7-led-matrix-on-my-arduino

I followed this tutorial specifically.
My arduino was wired per the instructions on that website

Also thank you for replying so quickly :)

Grumpy_Mike

He said:-
Quote
i use the led matrix without any other parts as shown in the arduino playground

That is one of the bad tutorials that can damage your arduino because there are no current limiting resistors in line with the LED. The lack of resistors won't stop it appearing to work though it will just do the damage. Note on the arduino page hey do mention that.

So it looks like you have not identified the wires into your matrix correctly. What have you done to ensure that the anodes and cathodes are what you think they are?

Exactly what did you see when you ran the code?

I looked up the pin out on the matrix datasheet. I matched what the tutorial said.. e.g. Arduino pin 2 to Matrix pin 9

The result after uploading the code it looked like all the LEDs were just refreshing on and off if that makes sense?

CrossRoads

These?
http://www.kingbright.com/manager/upload/pdf/TC20-11SYKWA(Ver1292470838.7)
So presumably you are driving the 7 anodes from something with current limit resistors, and sinking the 5 cathodes one at a time to turn on one column at a time?
Or are you  driving only 1 anode high and only 1 cathode low at a time for much slower multiplexing?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

It is this one ---> (http://www.kingbrightusa.com/images/catalog/SPEC/tc20-11ewa.pdf)

I am trying to drive each LED independently so I would be able to make a letter or number.


CrossRoads

Okay, one common way to tdo that is to drive all 5 anode hi or low, and pull one cathode, then repeat that for the next 4 columns quickly.
You will define some fonts, Imagine the letter A as a 7 tall x5 wide array with 1 = LED on and 0 = LED off:

1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1

So assuming an unused 8th bit that is always 0, each column could be represented as
01111111 = 0x7f
01001000 = 0x48
01001000 = 0x48
01001000 = 0x48
01111111 = 0x7f

So now you write some code that sends out a byte of data and 1 cathode control bit every 1mS:
Code: [Select]

void loop(){

// column 1
if (1mS elapsed){
all cathodes off
write anodes with 0x7x
turn on cathode 1
}

// column 2
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 2
}

// column 3
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 3
}

// column 4
if (1mS elapsed){
all cathodes off
write anodes with 0x48
turn on cathode 4
}

// column 5
if (1mS elapsed){
all cathodes off
write anodes with 0x7x
turn on cathode 5
}
} // end loop


Can you follow that?  You are the driving the LEDs for a column at a time, and using persistence of vision to make the eye think any LED can be on at any  time.
You can see how this would fit nicely into a loop, then expand from there to have the fonts predefined in an array where you would call up the letter/number in question, then expand from there to have say 3 letters in a 15 byte array and roll along to pick 5 bytes from that array for display (0-4, 1-5, 2-6, 3-7, 4-8, etc) to give the impression of scrolling text, and put new bytes in as needed to go thru your message...

Here's a video of my 8x32 display doing similar:

http://youtu.be/hwYqgyMc5S4

Scroll test of 8x32 LED matrix. Can hold up to 233 characters in SRAM. Will be ~40 more once I push 5x8 fonts out to PROGMEM.


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Really cool! thanks

could you just explain how i would wire up my matrix board to my arduino?

CrossRoads

#9
Oct 22, 2012, 09:54 pm Last Edit: Oct 22, 2012, 09:55 pm by CrossRoads Reason: 1
7 arduino pins with 220 ohm current limit resistors to the 7 anode pins.
5 arduino pins to 5 inputs on ULN2003A, 5 outputs to 5 cathode pins. Gnd to Gnd, COM is not connected.
Driving ULN2003 input high makes the output go low - only drive 1 input high at a time.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

Quote
I am trying to drive each LED independently

No you should not be doing. The point is that you have some memory that contains the bit pattern, then you apply that memory to the hardware. The code that does the refreshing does not change no matter what you display.
Read this:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

is this correct?

Grumpy_Mike

Quote
is this correct?

No.
The ULN2003 is wired up all wrong. The outputs should go to the matrix not the inputs, the ground should go to pin 8 not pin 10.

could you explain why the matrix is wired incorrectly? which way should it be?

Grumpy_Mike

Quote
could you explain why the matrix is wired incorrectly?

No I said the ULN2003 is wired up all wrong not the matrix.
I also said that:-
Quote
The outputs should go to the matrix not the inputs, the ground should go to pin 8 not pin 10.

That is the outputs of the ULN2003 should be wired up to the LED matrix not the inputs of the ULN2003 to the matrix.
You should connect pin 8 of the ULN2003 to ground, you have connected it to pin 10.

Go Up