Jump to content

Led Matrix Column Dimming


jbartee
 Share

Recommended Posts

So I'm nearing the completion of my midibox sid, and I've run into a strange issue. All the LEDs in my 8*8 matrix are a nice even brightness, but only if there is no more than one led lit per column. As more leds are lit in a given column, the brightness of all the leds in that column begins to dim. Adjacent columns are not effected, and neither are the other leds running off the same DOUT module that are not in the matrix.

There shouldn't be a problem with my power supply as it's capable of outputting 2 amps. In fact the current before the shift registers seems not to matter; I tried putting a couple thousand uF capacitance directly behind the power input of the concerned dout module to buffer the current, and it had no effect; therefore it seems like this is an issue with the current throughput of the pins on the shift registers, or something to do with the duty cycle of the multiplexing. I'm curious though because I haven't seen this behavior on videos of other completed midibox sids.

I'm using 5mm red leds from SmashTV. I've tried a variety or resistors and the issue persists no matter what.

So what's going on here? Is this a limitation of the chips? Some other problem? 5mm a no no? Any help at all would be truly appreciated...

Link to comment
Share on other sites

There are current limits on the output of each pin of the 74HC595, and also a current limit for sinking current. Assuming you have your matrix arranged in common cathodes in a column, connected to a 74HC595 pin, when that pin is outputting low (0V) and "selecting" that column, there's only so much current that it can sink... therefore depending on the output current (i.e. how many LEDs are turned on), this may affect how bright the LEDs will be.

One fix for this would be to increase how much current can be sinked by one column, by using a transistor like BC547 with base connected to the DOUT pin (via 1K) and the collector connected to the common cathodes and the emitter connected to ground. You would also need to invert the outputs on that DOUT, so a high output will "select" that column and sink current through the transistor collector. Thus you can sink 100mA per column of LEDs, and are then only limited by the output current of the 74HC595 (i.e. the same as a LED connected directly between DOUT pin and ground).

This is what I did on the MB-6582 base PCB, should you want to see an example (see the transistors in the lower left corner of the PCB).

Link to comment
Share on other sites

If you are using the SmashTV DOUT board, it is laid out so that you can fit on of the ULN series Darlington driver chips in place of the output resistors, slightly more costly than individual transistors, but way easier to fit.

SmashTV DOUT Page

Smash captions it a relay driver, but it will happily drive the ground end of the LED's too.

I've not checked my boards in detail, but Allegro and ST make High side/low driver chips that match in pinout, as I recall.

ULN2981 High side (source) driver

ULN2903 Low side (sink) driver

Hope this helps

Link to comment
Share on other sites

There are current limits on the output of each pin of the 74HC595, and also a current limit for sinking current. Assuming you have your matrix arranged in common cathodes in a column, connected to a 74HC595 pin, when that pin is outputting low (0V) and "selecting" that column, there's only so much current that it can sink... therefore depending on the output current (i.e. how many LEDs are turned on), this may affect how bright the LEDs will be.

One fix for this would be to increase how much current can be sinked by one column, by using a transistor like BC547 with base connected to the DOUT pin (via 1K) and the collector connected to the common cathodes and the emitter connected to ground. You would also need to invert the outputs on that DOUT, so a high output will "select" that column and sink current through the transistor collector. Thus you can sink 100mA per column of LEDs, and are then only limited by the output current of the 74HC595 (i.e. the same as a LED connected directly between DOUT pin and ground).

This is what I did on the MB-6582 base PCB, should you want to see an example (see the transistors in the lower left corner of the PCB).

Thanks Wilba and TheProf for getting back to me so quickly! This basically confirms what I thought was going on. Using transistors makes a lot of sense.

However I have two questions:

First, my matrix is arranged with common anodes in a column, not cathodes. It's all wired exactly as described here: http://www.ucapps.de/midibox_sid_cs/mbsid_v2_dout_default.pdf

How would this change what I need to do? It seems that this implies the problem is not with how much current can be sinked, since lighting up a whole row (common cathodes) gives me no trouble... or perhaps I'm fundamentally misunderstanding something?

Second, when you say I need to invert the outputs of the DOUT, I assume you mean in the setup.asm? urggghhh..... well, one more reason to go through the arcane process of setting up the development environment I guess.

Edited by jbartee
Link to comment
Share on other sites

Thanks Wilba and TheProf for getting back to me so quickly! This basically confirms what I thought was going on. Using transistors makes a lot of sense.

However I have two questions:

First, my matrix is arranged with common anodes in a column, not cathodes. It's all wired exactly as described here: http://www.ucapps.de/midibox_sid_cs/mbsid_v2_dout_default.pdf

How would this change what I need to do? It seems that this implies the problem is not with how much current can be sinked, since lighting up a whole row (common cathodes) gives me no trouble... or perhaps I'm fundamentally misunderstanding something?

Second, when you say I need to invert the outputs of the DOUT, I assume you mean in the setup.asm? urggghhh..... well, one more reason to go through the arcane process of setting up the development environment I guess.

Okay, after thinking about this a little more I think I should be able to fix this using 8 npn transistors switching plus five volts through the columns. Since I'm working with forward voltage to the anodes, no inversion should be required for the dout. Does this make sense?

Edit: actually, it seems like I'll need 16 transistors in order to invert the output... so two npn transistors to each column. Unless I'm totally off my rocker.

Edited by jbartee
Link to comment
Share on other sites

Just to clarify what I mean, here's a crude schematic. This way, when the pin is high then 5 volts are supplied to the column directly from the power rails instead of via the shift register. I implemented a simple version of this on a breadboard (just one LED) and it works in principle. Guess I'll throw it all together and see if it fixes the issue!

post-7195-126662867411_thumb.jpg

Link to comment
Share on other sites

Just wanted to update that I solved the problem, but the transistor schematic I posted ended up being unnecessary. I simply ended up using 64 220 ohm resistors so that the current gets controlled uniquely for each LED, instead of using one resistor for each column. This is better practice anyway, and it completely eradicated my dimming. I guess the problem had nothing to do with current limits at the shift register, and everything to do with slightly different operating parameters on each led, which was causing the current to branch strangely across the parallel circuits.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...