Pages: 1 2 [3] 4   Go Down
Author Topic: Need help: How to make my own 24x16 LED Matrix display  (Read 6678 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Many (most?) shift registers have a  high impedance state, with their output enable turned off - they look like an input then, allowing something else to drive the bus.
Logged

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.

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many (most?) shift registers have a  high impedance state, with their output enable turned off - they look like an input then, allowing something else to drive the bus.

They do, but high impedance can be applied for either all the pins or none of the pins i.e. output enable turned off or on. It can't be done for say, one of the 8 output pins. Checked this on both, the 4094 and the 595.

In any case, I've been able to make some progress today. I've got to the point of taking a matrix of 24x16 bits (48 bytes) and putting it on the display. On the simulator of course. Code currently uses shiftOut and no asynchronous updating of the display. Once I'm able to make it more flexible, the next steps would be to use SPI for the shift registers and use interrupts so that any updates to the display can be done asynchronously.
« Last Edit: June 23, 2012, 09:33:58 am by plastygrove » Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a few leftover PCBs from my LED matrix shield, which I can send to you to experiment, if you are interested:
http://timewitharduino.blogspot.ca/2010/12/new-and-improved-dual-led-matrix-shield.html
They use 595 (4 pieces) and one ULN2803. Connect your own matrices to the board with wires (I don't think you have the same exact ones I have used).
Logged

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a few leftover PCBs from my LED matrix shield, which I can send to you to experiment, if you are interested:
http://timewitharduino.blogspot.ca/2010/12/new-and-improved-dual-led-matrix-shield.html
They use 595 (4 pieces) and one ULN2803. Connect your own matrices to the board with wires (I don't think you have the same exact ones I have used).

That would be awesome, thanks! smiley But I'm in India, is there a non-expensive way to ship them over here? Very nice blog btw, I did stumble upon it some days ago when I was researching on this topic. I hope to be able to make my own shields sometime.

Here's the progress on my board though. I've gotten the code to a point where I can place an 8x8 pattern anywhere on the 24x16 grid and it renders it fairly well. In the attached image, you can see the letter 'A' slowly drifting across the display. Of course, wiring these up on a breadboard will be next to impossible, so I'm trying to learn eagle cad so I can design a PCB and get it printed. But looks like that'll take time smiley-sad.



* 24x16_working.jpg (186.04 KB, 1158x256 - viewed 41 times.)
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Very nice blog btw
Thanks.
PM me with your address and I will send the PBCs to you.

How do you simulate running the code? And how did you generate the pretty picture with the character on the LED matrix?
Logged

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sent you a PM with my address. Thanks once again, that's very generous of you! smiley

How do you simulate running the code? And how did you generate the pretty picture with the character on the LED matrix?

I'm using Proteus to simulate the circuit. Here's a great tutorial which explains how to set it up. It just takes a few minutes to set it up. You have to use the Hex file that the Arduino IDE generates in your AppData temp folder and it works. Of course, it can't simulate as fast as the real thing, but it's great for prototyping.

Unfortunately, nothing fancy about the picture. Just ran the simulation, paused it, took screenshots and put them together in mspaint. Quick 5 mins smiley.
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have been experimenting with CrossRoads' schematic with pull-up resistors for a single 8x8. For one thing, the LEDs are brighter than when powering it through the pins directly. However, when 6-8 LEDs in a single column light up i.e. all powered through just one pin on the shift register, they're noticeably dimmer than when running just 1-2 LEDs.

Is there a way to keep the brightness constant irrespective of the number of LEDs that are lit up in a column? Maybe a constant current source?
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry I can't fully answer your question although I do believe that you can use a transistor that will switch when there is an amount of current going through.  Now this wouldn't be used to bring the brightness up for the 6-8 but more so to bring the brightness down from the 1-2 leds.  May not be the best but it would be consistent.
Logged

Accelerate to 88 miles per hour.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"However, when 6-8 LEDs in a single column light up i.e. all powered through just one pin on the shift register,"
Is this the shift register that is sinking the cathode current?
Otherwise I do not think your multiplexing is working correctly.

The LEDs in a column are each powered from their own pullup resistor. The cathodes are all sunk together.
The TPIC6B595 can sink 500mA, so 160mA from 8 LEDs should not be a problem.
Logged

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.

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you can use a transistor that will switch when there is an amount of current going through
Not sure I follow completely. You mean a separate power source through the transistor which would be triggered by the shift register? Or perhaps connected directly to the pull-up. But again, I'm not sure if that would give me consistent brightness levels.

Is this the shift register that is sinking the cathode current?
Yes, one pin on the cathode shift register sinking the current from 8 pins of the anode shift register. I've attached a photo which shows the problem. The other alternative I tried was to have no more than one LED turned on at a time. But this increases the number of cycles by 8 times which is definitely not cool. The scanlines become visible in a camera. Also, the LEDs are considerably less brighter.

The TPIC6B595 can sink 500mA, so 160mA from 8 LEDs should not be a problem.

The store near my place didn't have 595 registers. So I'm using the HCF4094B which was all he had. Could that be the problem? Would the 74HC595 register do or would I need to use the TPIC6B595?


* IMG_0423.JPG (241.43 KB, 1000x750 - viewed 38 times.)
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm, well, HCF4094B has ratings of 3.4mA of sink current.
Am surprised it hasn't burned out trying to sink 160mA  of LED current.

74HC595 has absolute max of 35mA on any IO pin and 70mA max current thru the +5 or Gnd pin.

Order  yourself some TPIC6B595's, or use NPN transistor on the outputs of your shift register.
Logged

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.

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm, well, HCF4094B has ratings of 3.4mA of sink current.
Am surprised it hasn't burned out trying to sink 160mA  of LED current.

Thanks! I revisited the basics (read Ohm's law) and took a much closer look at all the datasheets including my 8x8 board (Over here).

Assuming a voltage of 5V being applied across each LED and a voltage drop of 2V, that gives me 3V effective between each LED. I always use 1K resistors with LEDs, so that gives me 3/1000 = 3mA of current.
With 8 LEDs running the cumulative output of the pins connected to a common cathode is 8x3 = 24mA.

The HCF4094B datasheet that I'm looking at suggests that absolute max current is +/-10mA. Doesn't that mean sink current as well? The only place I see 3.4 in the sheet is in a table titled "static electrical characteristics", is that the one I should look at?

So, I'm definitely overshooting the statutory current limitations, with the cathode. This explains why 8 LEDs in a single column are not bright. But shouldn't the same apply if I'm using a single anode and multiple cathodes to power an entire row? The LED brightness doesn't dim then. This would seem to suggest that the max output current is greater than the max sink current. Is that how these ICs normally are?

Order  yourself some TPIC6B595's, or use NPN transistor on the outputs of your shift register.

Yup, I'll do this for sure. If I want to drive a 24x16 display, I'll need to run at least 16 LEDs in one shot which would come to about 48mA in my circuit. Don't want to take chances smiley.
Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The +/-10mA is INPUT Current.

Page 8 shows the Output Drive Current (IOH) and the Output  Sink Current of 3.4mA for HCC parts, and just 3.0mA for HCF parts.

"But shouldn't the same apply if I'm using a single anode and multiple cathodes to power an entire row?"
That says to me that you are not TIME multiplexing correctly.
You drive the anodes, and turn on 1 common cathode.
You drive the anodes, and turn on the next common cathode.
repeat, turning on 1 cathode at a time.
Do it quick enough, such as 1/8 of 1/24 second per cathode, (movie speed) and the eye will see them as all being active all the time.
Logged

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.

India
Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
Silicon Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You drive the anodes, and turn on 1 common cathode.
You drive the anodes, and turn on the next common cathode.

You know, that's actually what I'm doing. The code I'm using iterates over the cathodes while driving the anodes. I think I should take a break and do something else, I'm getting all confused smiley-eek

Code:
byte samplePattern[]={
  B10000000,
  B11000000,
  B11100000,
  B11110000,
  B11111000,
  B11111100,
  B11111110,
  B11111111,
};

void parsePattern(byte pattern[]){
  int wait=0;
  for(int i=0; i<255; i++){
    for(int j=0; j<8;j++){
      show(pattern[j], (1<<j));
      delay(wait);
    }
  }
}

void show(byte high, byte low){
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, ~low);
  shiftOut(dataPin, clockPin, MSBFIRST, high);
  digitalWrite(latchPin, HIGH);
}

« Last Edit: July 05, 2012, 01:38:58 pm by plastygrove » Logged

My blog Emptiness in Void. New to Microcontrollers? Learn [url=http://www.arduino.cc/playground/Cod

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be  you're just going too fast, got too much flashing too quick, the eye can't take it in.
Slow it down some, and clearly turn off a column before turning on the next one.
Code:
for (x = 0 to 7){
all cathodes off
anodes [x] on
cathode [x] on
delay(# >0, like 2)
}
« Last Edit: July 05, 2012, 04:31:42 pm by CrossRoads » Logged

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.

Pages: 1 2 [3] 4   Go Up
Jump to: