Shop OBEX P1 Docs P2 Docs Learn Events
Uneven brightness of the LED matrix display? — Parallax Forums

Uneven brightness of the LED matrix display?

John A. ZoidbergJohn A. Zoidberg Posts: 514
edited 2010-11-10 10:00 in General Discussion
Hello there,

I just constructed a simple LED matrix display, and found something funny there - the brightness of these LEDs are uneven.

For example, I put a pattern which is the "1" on these LEDs, and the stem of the "1" seems dimmer (column with more LED lit) and the sides (column with less LED lit).

How could I make it to have the same brightness for all the LEDs inside?

By the way, I'm using the 74HC595 for the column drivers, and the ULN2803 to sink the currents. Tried removing the ULN2803 - no effect. :lol:

Any ideas for LED matrix for Prop systems? Thanks. :D

Comments

  • hover1hover1 Posts: 1,929
    edited 2010-11-06 11:32
    Hello there,

    I just constructed a simple LED matrix display, and found something funny there - the brightness of these LEDs are uneven.

    For example, I put a pattern which is the "1" on these LEDs, and the stem of the "1" seems dimmer (column with more LED lit) and the sides (column with less LED lit).

    How could I make it to have the same brightness for all the LEDs inside?

    By the way, I'm using the 74HC595 for the column drivers, and the ULN2803 to sink the currents. Tried removing the ULN2803 - no effect. :lol:

    Any ideas for LED matrix for Prop systems? Thanks. :D

    It would be a guessing game without some form of wiring diagram, schematic; and the code that is driving it.

    Jim
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-11-06 12:53
    My guess is that you are trying to drive everything at 5 volts. Is that so?

    I suspect that if the LED matrix is driven at something higher - say 9-10vdc and the current limiting resistors and pulse width is tweaked, you will get consistent brightness. I have spent a lot of hours trying to squeeze out a 5 volt solution and it just is too marginal.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-11-06 13:35
    I've found that putting a 10 millisecond (may be adjusted) pause between pulses in your code can prevent this, but I'm no expert.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2010-11-06 14:52
    Are you using a separate resistor for each LED segment?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 15:44
    It could just be a matter of the 'HC595 not having enough poop to drive several LEDs at full current. Without a more robust column driver, you could try increasing the series resistance to dim the LEDs. At least they'd be more uniformly dim.

    -Phil
  • hover1hover1 Posts: 1,929
    edited 2010-11-06 16:34
    John,
    Speculative answers have been offered, as I said, it's a guessing game, but you need to provide some hardware information. What is the current draw on the LEDs. Better yet, can you supply a data sheet for the LEDs, wiring, and code?
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-06 18:12
    Here is the wiring diagram - I afraid the +5V might not be enough, but I've seen +5V configurations with higher and consistent LED brightness.

    Edit : The ULN2803 should be drawn with +5V and also a ground, which I accidently left when I draw the diagram. In the prototype, I've connected it the supply and ground to the sink driver.
    931 x 519 - 22K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 20:28
    Which are you driving in parallel, the rows or the columns? IOW are you scanning one row at a time or one column at at time?

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-06 21:07
    Which are you driving in parallel, the rows or the columns? IOW are you scanning one row at a time or one column at at time?

    -Phil

    I'm scanning the rows using the 74HC595. One at the time.

    Or must I use the CD4017?

    Edit: The currents are then drained through ULN2803 which serves as a column driver too.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 22:42
    Okay, let's get our terms straight. In your first post you said, "I'm using the 74HC595 for the column drivers," which agress with your block diagram. In your last post you said, "I'm scanning the rows using the 74HC595. One at the time," and, "The currents are then drained through ULN2803 which serves as a column driver too." I think you can understand my confusion.

    At any rate, if the 'HC595 is driving the columns in series and the ULN2803 is sinking the rows in parallel, your resistors need to be in series with the ULN2003 outputs, not the 'HC595 outputs.

    But it would be much better to keep your current configuration and drive your columns in parallel with the 'HC595 and one row at a time with the ULN2003. The reason is that whichever device is driving one row or column at time might have to sink or source the current from 8 LEDs at once. The ULN2803 is much better equipped to do this than the 'HC595.

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-06 23:07
    Okay, let's get our terms straight. In your first post you said, "I'm using the 74HC595 for the column drivers," which agress with your block diagram. In your last post you said, "I'm scanning the rows using the 74HC595. One at the time," and, "The currents are then drained through ULN2803 which serves as a column driver too." I think you can understand my confusion.

    At any rate, if the 'HC595 is driving the columns in series and the ULN2803 is sinking the rows in parallel, your resistors need to be in series with the ULN2003 outputs, not the 'HC595 outputs.

    But it would be much better to keep your current configuration and drive your columns in parallel with the 'HC595 and one row at a time with the ULN2003. The reason is that whichever device is driving one row or column at time might have to sink or source the current from 8 LEDs at once. The ULN2803 is much better equipped to do this than the 'HC595.

    -Phil

    My mistakes on the first post - It should be the 74HC595 driving the rows (because of the anodes), and the ULN2803A with the columns (because of the cathodes).

    I've checked around - most of the home made displays used this configuration. However, I may be wrong here. I based my design on that diagram below:

    4316-14_1194402379.gif
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 23:22
    Okay, I'm still confused. In the diagram you just posted, the 'HC595s are driving the columns, and the ULNs are driving the rows. Is your circuit like that diagram?

    In any event, whatever the 'HC595 is driving, it needs to drive as many as all eight of them at once. The ULN2803 can drive only one of its constituent outputs at a time.

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-06 23:26
    Okay, I'm still confused. In the diagram you just posted, the 'HC595s are driving the columns, and the ULNs are driving the rows. Is your circuit like that diagram?

    -Phil

    Sorry for the confusion. I have slightly modified the contents in the diagram. Mine is using the 8x8 Matrix instead of the 5x7 matrix, and on times, the rows and columns can be confused because the 8x8 matrix is an entire square.

    In my very own circuit witn the 8x8 matrix , the rows are driven using 595s and the columns are sinked using the ULN2803.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 23:28
    So how many ULN2803 outputs can be on at a time?

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-06 23:50
    The ULN2803 outputs can be up to 8, while the row-scanning 74hc595 is just one by one.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-07 00:00
    That's your problem. You need to scan the other way: one ULN2803 output on at a time, and up to eight 'HC595 outputs active at once.

    What's happening in your present situation is that the 'HC595 may have to drive 8 paralleled LEDs at once, though a single resistor. This is a problem for two reasons:

    1. HCMOS devices are not capable of high current output, and

    2. The LEDs are being driven in parallel without individual load-limiting resistors. Because their forward voltages can vary slightly, some will draw more current (and be brighter) than the others.

    Scanning one ULN output at a time with the 'HC595 outputs in parallel will solve both problems.

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-07 00:03
    That's your problem. You need to scan the other way: one ULN2803 output on at a time, and up to eight 'HC595 outputs active at once.

    What's happening in your present situation is that the 'HC595 may have to drive 8 paralleled LEDs at once, though a single resistor. This is a problem for two reasons:

    1. HCMOS devices are not capable of high current output, and

    2. The LEDs are being driven in parallel without individual load-limiting resistors. Because their forward voltages can vary slightly, some will draw more current (and be brighter) than the others.

    Scanning one ULN output at a time with the 'HC595 outputs in parallel will solve both problems.

    -Phil

    Thanks for the opinions. I need to redo the design. Hold on while I fix the drivers. :D

    Edit: This solves the problem - however, there is one funny little problem.

    As you can see in the photos enclosed, it shows the number one nicely - but the end of the number one has some trails of dimly-lit LEDs inside. It looks like it's ghosting effect. I also have to enclose the program code here. Another picture is just the inverted version of the first one to show that there are still trails of that dim LEDs there.
    1600 x 1200 - 419K
    1600 x 1200 - 471K
  • kwinnkwinn Posts: 8,697
    edited 2010-11-07 07:37
    John, according to the schematic you posted with the 8 displays, the ULN is driving the rows and the '595s drives the columns. This should work fine provided the program sequence is correct. The ghosting is caused by the old row of data being displayed for a brief moment before the new data is shifted to the '595 output register.
  • kwinnkwinn Posts: 8,697
    edited 2010-11-07 08:36
    John, the spin program you posted will not work with the schematic you posted earlier. I am assuming you are driving the ULN directly from pins 16-23 now. I have added one line to remove the ghosting and some comments to the program and attached it.

    To remove the ghosting with the hardware in the schematic you posted earlier you need the ‘595 register latch clock and new row address to be output simultaneously. That requires removing lines 50 & 51 and replacing lines 30 – 35 in the current program.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-07 08:43
    Your problem is here:
    repeat
      [color=red]shift(col_data[col_num])
      outa[16..23] := rows_num[/color]
      rows_num := rows_num << 1
      col_num++
      if rows_num > 128
        rows_num := 1
        col_num  := 0
    
      waitcnt(50_000 + cnt) 
    

    You're shifting new data into the '595 and displaying it while the old value is still present in the ULN. You need to turn off the ULN entrely (i.e. outa[16..23]~), then shift data into the '595 and latch it, then turn the ULN back on with the new data.

    Or, better yet:

    1. Shift data into '595.
    2. Turn off ULN outputs.
    3. Latch data in '595.
    4. Set new ULN output.

    This will help to reduce flicker.

    -Phil
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-07 17:06
    Thanks for the opinions. I will shut off the ULN2803 or the '595 during the shift. Will do that in the afternoon. :D
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-07 23:49
    I shut off the ULN2803's outputs prior to shifting, and it worked!

    I'll post the simple driver code here later as I need to housekeep the codes so that it is readable.

    One thing is, now I'm thinking of putting a pool of characters, A-Z and 1,2...,and to 0 (and all the other things like symbols) inside the Prop. Or should I place them in a seperate EEPROM? :smilewinkgrin:

    Besides the casual 5x7 fonts, any other stylish fonts to be fit into the LED matrix? I prefer the "blackboard bold" style, found it in the net one day but I forgot to bookmark it... :lol:
  • lardomlardom Posts: 1,659
    edited 2010-11-10 08:35
    Thanks for posting this thread. I became curious about led matrices a couple of days ago after 'bragging' to my my wife that I could create an led display. After a munute of thought I realized one pin-per-led is not the way it's done. The truth is I will be able to do it because the members of this forum will educate me. My "ego deflating pin" is within sight on my desk. :)
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2010-11-10 10:00
    lardom wrote: »
    Thanks for posting this thread. I became curious about led matrices a couple of days ago after 'bragging' to my my wife that I could create an led display. After a munute of thought I realized one pin-per-led is not the way it's done. The truth is I will be able to do it because the members of this forum will educate me. My "ego deflating pin" is within sight on my desk. :)

    Welcome. It's a very very common project among many microcontroller hobbyists, and even college projects. One of the college projects I've seen is the LED matrix, but using PIC microcontrollers.

    Multiplexing is generally done at these LED matrix displays. That goes the same for the seven-segments too. (the older one with the nixies are different though, these are interfaced with 7447s IIMNM) :D
Sign In or Register to comment.