Scrolling 640 LEDs

Hello all,

I am building an 8 x 80 scrolling LED sign for fun. The basic design centers around an Atmel Mega88 microcontroller which is connected to a

4-to-16 decoder and 5 74hc595 shift registers. The individual matrices (each measuring 8 x 8, 10 in total) are arranged in a 2 x 5 configuration. The 4-to-16 decoder will act as the row driver while the shift registers will handle the columns. There is no way that neither the microcontroller nor the 4-to-16 decoder can supply enough current to the LEDs (if an entire row is lit that means that the display will consume 15ma * 40 LEDs = 0.6A) so I was thinking about using transistors on each of the 16 row pins. The only problem with this configuration is that the LEDs would have to be placed on the emitter of the transistor which has a voltage drop of 0.7V thus extinguishing my LEDs. Does anyone know of a better way to configure/ handle this kind of power switching? I am trying to avoid placing a transistor on each of the 40 column pins in order to keep component count down. Suggestions? Thanks.

-cheers Brad

Reply to
Mystik738
Loading thread data ...

When using transistors as switches, the load should always be on the collector side. If you're putting the transistor between V+ and the load, use PNP transistors, else use NPN transistors.

If the Vce voltage drop is too much, perhaps MOSFETs would be a better choice?

Reply to
DJ Delorie

So if I were to use PNP transistors I would hook the emitter up to V+ and the collector up to the common anodes of that row? Then I could hook the base up directly to the 4-to-16 decoder and all will be well. Or will the transistors still drop the voltage before it reaches the LEDs? I have not yet used PNP transistors in any of my projects so I am not sure. Thanks again.

-cheers Brad

Reply to
Mystik738

So it's a 1:16 muxing arrangement. You specify 40 LED values via the (5) 74HC595s and enable the 4-16 decoder (74154 type?) for a time, then the next 40 LED values and the next decoder enable. Possibly with a small blanking moment while you load the 74HC595s.

You might also want to consider transistors on the 40 74HC595 outputs, as well. With 1:16 multiplexing going on, I suspect you will want to drive the LEDs, when ON, at a substantial over-drive level -- on the order of 10-20 times what they would get if left on all the time.

Are these the better low-current LEDs?

Can you explain that? I've usually used the collectors on both the row and column sides, towards the LED drive lines.

Well, at what current do you expect to drive the 40 column LEDs? I'm guessing it will be a lot more than the 74HC595 will sink. Assuming only 2mA as about enough, continuous duty, you are talking about 32mA aren't you? (With the 4-16 output driving up to 80mA?)

Jon

Reply to
Jonathan Kirwan

Connect the LED anodes together, and connect the collectors of a ULN2803 or so, 8 transistors in a package. Of course, each LED still needs its own series current-limiting resistor.

Or, to drive the LED anodes, use PNPs and invert your outputs.

Good Luck! Rich

Reply to
Rich Grise

It sounds like you are planning upon using a 16 x 40 arrangement. Another option would be to use a 24 x 27 arrangement. This would cut the number of power handling elements from 56 (16 + 40) to 51 (24 + 27). A 25 x 26 arrangement could also be used however this would complicate the data output slightly.

Reply to
Dan Coby

Yup. Thant is it exactly.

I doubt it. I ordered 10 of these for $4.95. They did not even come with specs (although, I did find some specs later that said the LEDs were 2V 5-15mA). I don't want the sign to be too bright so I was not to concerned with overdriving. Should I be?

If I put a transistor on the column side, I need 40 transistors (one for each column) which I am trying to avoid in order to keep component density (and more importantly: cost) down. Putting the transistor on the row side would mean that the led is across the emitter of the transistor which has the voltage drop.

Each LED should be driven at 15mA. I wanted to put the power switching between the 4-to-16 decoder so that neither device would have to sink or source the whole load (the 4-to-16 would only have to source enough to activate the transistor and the 74hc595 would only have to sink one LED per pin [or so I thought]). Am I missing something?

-cheers Brad

Reply to
Mystik738

Yup. It's just like an NPN, but "mirror imaged" relative to the power supply.

Assuming the 4-to-16 doesn't drive the transistor when it's high (look for CMOS-level output, Vdd-0.5v, rather than TTL output of 2.4v). Also, you should put a resistor between the chip and the base, to limit current to what the chip can drive. Example: 5mA max drive,

3.3v supply, R = 660 ohms (3.3/0.005) minimum. The max value depends on the hFE of the transistor and your desired drive current.

It will, see the Vce value in the transistor's spec. It's not the same as the Vbe drop that you're probably thinking of. Note that bipolar transistors are usually measured in terms of current, with voltages being a by-product.

Again, if you need less drop, you might want to look at MOSFETs, which act (switch-wise) like bipolar transistors, base=gate, collector=drain, emitter=source, except that the base current is negligible and the Vds is very low.

Reply to
DJ Delorie

Yes.

You need a resistor in the base lead. But the main thing to note about using PNP transistors is that the decoder outputs need to be active-low (open-collector will work).

The voltage drop is between the emitter and the base. The base voltage will need to be above V+ - 0.65 to turn the transistor *off* and below that to turn it on.

A circuit with PNP transistors is a "mirror image" of the equivalent PNP circuit. The emitter is connected to the positive rail, current flows into the emitter and out of the base and collector. The transistor conducts when the base is at least 0.65V *below* the emitter.

Reply to
Nobody

Thanks.

Okay. So let's say (as you say below) that you want to drive these so that they _look_ like they have a brightness of about what they would when given 15mA, continuous. Then, if you are going to multiplex these in a 1:16 arrangement (as it appears you will) you will need to drive them at __more__ than 15mA for the much shorter time they will be driven. In other words, something on the order of 16*15mA, or about 240mA. Call it something in the area of between 150-250mA. That's a lot.

Also, you need to consider the fact that the row driver (whether that is a PNP or NPN) will need to source/sink up to 40 of these. So now you are talking about up to some 40*240mA or 9.6A. That matches up with a general calculation that says your power supply should be able to handle up to 15mA*640 or.. again.. 9.6A.

That's a LOT! Big time.

Plus, if you want to avoid flicker (especially if someone is moving their eyes around while looking) then you will need to mux these at a fairly rapid rate. I find that 45Hz works for me for a lot of use, though 75-90Hz is better. This means 15*45 or 720Hz rate for loading your series of 74HC595s. Faster, if you want something like 75-90Hz blinking rate. Call it roughly once per millisecond. Can you load out 40 bits at a time each millisecond?

okay. That's not needed if you use PNP and NPN transistors. I'll put out a diagram below.

If each LED should be driven at 15mA and if you can have up to 40 of them on at the same time, then that would suggest that your row driver needs to supply 40*15mA or 600mA. However, keep in mind that your LEDs will then look as though they are being driven with 15mA/16, or about 1mA. If that is okay, then fine. If not, you've got those big time problems I mentioned earlier. By the way, I think the 74HC595 sinks under 10mA.

Jon

P.S. Here's an example, viewed in a fixed spaced font only. It's a 3x4 (or

4x3, your call), so you will need to conceive that this is actually a 16x40 in your case. But the idea is there. Also keep in mind that there are specialized LED driver packages. They cost a lot more than the transistors, but they are easier to use.

COL 3

+------------------------+------------------------+------------------------+-----------,

| | |

| | |

--- --- |

\\ / D20 \\ / D21 |

--- MYDIODE --- MYDIODE \\

| | / 22k

| | \\

| | /

| | |

| | |

| | |

| | gnd

| |

| |

| COL 2 |

+------------------------+------------------------+------------------------+------------------,

| | | |

| | | |

| --- | |

| \\ / | |

LED | --- LED | \\

| | | / 22k

| | | \\

| | | /

| | | |

| | | |

R| | R| |

W| | W| gnd

| | |

C| | D|

| COL 1 | |

+------------------------+------------------------+------------------------+-------------------------,

| | | | |

| | | | |

| --- | | |

| \\ / | | |

| --- LED | | \\

| | | | / 22k

| | | | \\

| | | | /

+------+------' +------+------' |

| |

| |

| |

|/c gnd

D----/\\/\\----| NPN

|>e

|
|

\\

/

\\

/
|
|
|

gnd

Reply to
Jonathan Kirwan

In your experience, is 15mA crazy talk? I noticed that you mentioned

2mA earlier which seems a lot more realistic after hearing that. is 1mA bright enough for a simple wall sign? The microcontroller is running at 20Mhz so I think I can do it in time. I do not know what kind of platform you would run yours off of, so I have nothing to compare it to.

Ah, now I see what you mean.

I can't remember off hand what the 74HC595 sinks, but wouldn't it only have to sink the current for one LED at a time since there is a discrete pin for each of the 40 LEDs and I am only lighting one row at a time?

Any one in particular that you are fond of?

-cheers Brad

Reply to
Mystik738

If you haven't gotten the LEDs yet, what you want to do is look at the "lumens" spec. They vary in brightness (lumens) at their rated current (usually 20mA). If you get a brighter LED, you can use a lower current to get the same brightness, or get a brighter sign for the same drive current or duty cycle.

In 0603 SMT leds, there's easily a 10:1 range in brightness at 20mA.

Reply to
DJ Delorie

But recall the duty cycle - you want an AVERAGE of, say, 20mA per LED. If it's a 1/40 duty cycle, you have to pulse 20*40 = 800mA through that LED to get the same *effective* brightness as a constant 20mA.

Reply to
DJ Delorie

Too late. I already have the LEDs. I hooked one up to 2V without a current limiter for a second and it was plenty bright. I am unsure if

1/16 of that brightness will be enough, though.

-cheers Brad

Reply to
Mystik738

Good point. I think that I am going to throttle back the amount of current for each LED. I am not really looking for a super bright sign (actually I don't even know where I am going to put it yet).

-cheers Brad

Reply to
Mystik738

Yes.

In the worst case, each row has to be able to source current for 40 LEDs on a 1:16 duty cycle, while each column has to be able to sink current for 1 LED continuously.

Reply to
Nobody

2V on a regular (old-timer) red LED produces about 20mA or so. I think the equation was something like (2V-1.55V)/21, which would be something like 21mA. Hard to know, though, since the range of possibilities is pretty wide, these days. If you have an ammeter you could use, you could verify the actual current using the 2V supply.

Brad, do you also have a way of turning on one of your LEDs for 1/16th duty cycle at, say, 45Hz? Might be nice to just tinker one of them around at a likely cycle rate and figure out the drive current while you look at it and make sure it is what you want.

By the way, did you consider the rep-rate you will need to maintain into your 74HC595s that I mentioned? Can you achieve it? 40 bits at some 720Hz, or almost a 30kHz bit rate?

Jon

Reply to
Jonathan Kirwan

Here is the listing for almost the same displays (mine are red):

formatting link

I found a similar listing to my displays that said 2V 5-15mA which doesn't sound unreasonable since the individual diodes are only 1.9mm.

I am actually already working on something like that which would just light one light on one display for tuning purposes. I could probably implement a software duty cycle that can be adjusted for tuning.

The microcontroller I am using clocks in at 20Mhz so that should not be too much of a problem. I think the main limiting factor is going to be the propagation on the 74HC595s.

-cheers Brad

Reply to
Mystik738

Well, the green will have entirely different voltage values and current-to-apparent-brightness issues. Human color perception is NOT the same for red and green.

But I see what you are talking about, in terms of having them nicely pre-positioned for you. Nice.

Well, let's say that you were looking at about 20-25mA when you hooked up 2V. And that this is perhaps too bright and that you will eventually find that 10mA is a "good value." With a by-16 multiplex design, you will need to drive approximately 10mA*16 = 160mA into each LED when it is ON, in order to achieve the same effect (assuming your repetition rate is fast enough that a person doesn't see the blinking.) Now, this may actually need to be a little higher because of some blanking time between activations of the row driver. But call it 160mA. That's just one LED! The voltage you will need for that much current will also be somewhat higher than for 10mA, too. So make sure your power supply has enough voltage compliance for your need.

With your 16x40 arrangement, you will need to have a row driver that can supply current for up to 40 of these, too. So 40*160mA, which is

6.4 amps! That's probably going to require TWO transistors for each row driver (or a MOSFET) and a decent transformer for your supply.

I gave you a diagram that includes resistors in the NPN emitters of the column drivers (I think I labeled them wrong, but who's counting?) that will permit you to regulate the current, easily. So your power supply doesn't have to regulate a precise voltage, it just need to supply a lot of current and maintain enough voltage headroom for the duration.

The point in all this is to tell you that you've got a big multiplier operating here (x16) and to force you to do some testing. You really need to make sure about what level of continuous current is needed for a maximum brightness you like. (You can always adjust that downward by reducing the on-period within your 1/16th duty cycle.) And then test the idea by multiplying up the current to something in the area of 160mA (once you are sure you have a 1/16th duty cycle working at about 45Hz, let's say.) That in hand, with a realistic value you can use determined, you are good to go for a final design step.

Yes. It doesn't need to be difficult. Just use some configuration constants to set your loop counts. If you have a scope, the result becomes really easy to measure and you can quickly tinker the constants to a proper value. Otherwise, you can always do a cycle count on your loop to work out the predicted situation and just assume that it will work that way.

I think they will be plenty fast enough for a few tens of kHz. I was just worried about bit-banging out the serial stream and leaving much time for anything else.

Jon

Reply to
Jonathan Kirwan

I am aware of the difference in color perception, but they are not listing red display at the moment and that was the closest I could find.

I am thinking about pulling the current back to 5mA which would give me 80mA per pin which, in turn gives me 3.2A for an entire row. My current plan of action is to use 16 MOSFETs on the rows with 40 transistor on the columns. I am still going to do some testing for optimum values, but those numbers sound the most plausible at the moment.

I was thinking about about halving the multiplier (8 x 80), but that would just double the current requirement so there is no real gain since speed isn't the issue.

I was planning on doing all of the drawing via an on-chip interrupt so I can adjust the interrupt timing to fiddle with the cycle. Nothing really complicated.

If I remember correctly, I think the 74HC595 has a propagation delay of 16ns. I am not sure if this is a pin to pin delay time or an input to output time (although I think it is the former).

-cheers Brad

Reply to
Mystik738

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.