LED driver

I know that the Arduino doesn't have enough power to drive a bunch of LEDs so an amplifier would need to be inserted between the Arduino & the LEDs. That's what confuses me. The amplifier can be a transistor or an op amp or a LED driver IC. There are several different types of transistors. Which type would be used & why? Would it source current or sink current or does it make any difference? Which op amp would be used? Which LED driver IC would be used? I believe in the KISS principle. Which would be the simplest- transistor(which type) or op amp or LED driver IC?

You have the question posed in the wrong order...

Which would be the simplest- transistor(which type) or op amp or LED driver IC?

exchange the first and last of the three options.
A specific driver is always preferred to jinning one up from components and PWM is usually the preferred method as the excess energy is always expressed as heat in any type of linear (transistor or Op-Amp) current regulator.

Doc

exchange the first and last of the three options.

OK. So, that's LED driver IC or op amp or transistor, in that order.

OK, a few more questions. There are 2 methods to scan a matrix - column scanning or row scanning. Is one better than the other or is it 6 of one & half-dozen of the other? RGB LEDs can be common anode or common cathode. Is one better than the other or is it 6 of one & half-dozen of the other? Current sinking or current sourcing? Doesn't that apply only to transistors? And transistors are your last choice of the 3 that I mentioned.

Actually, an op amp is not one of the options, which is perhaps what Docedison meant to say.

You could perhaps split hairs and argue that some op-amps are capable of driving LEDs (or arrays), but that is simply not the design function of op-amps.

Now, as to scanning, the principle is to scan as few dimensions as possible, and have as many as possible in the other direction. This is simply because there is a limit to how much peak current can be safely fed to LEDs and whether the light output actually increase in proportion to drive current. Since each element scanned is only lit for the fraction of the time corresponding to the number multiplexed, you want that number to be reasonably small, generally no more than eight.

So for a "times square" display which is about eight rows high but a significant multiple of this in columns - 32, 64 etc., you would generally scan by rows so that the multiplex number is eight. On the other hand, a 7-segment display is generally scanned by digit - "column" as it is more practical to decode the digits one at a time. If however, there are more than eight digits, the approach may need to be changed.

And in many cases it will be practical to approach this by dividing the display up into separately driven sections where the numbers work better. Using a chip such as the versatile MAX7219 to drive an 8 by 8 matrix or eight 7-segment displays, favours dividing the array up into those units and takes care of the multiplexing for you.

RGB LED's complicate matters by requiring three times as much circuitry and not dividing so easily into binary values. You can for example, only control 16 of them with a MAX7219 instead of 64 separate LEDs or LEDs in a monochrome matrix. 8 by 8 LED matrices are a real headache to drive.

The "common" element must correspond to the multiplexing driver of the available IC or transistor array. This of course applies only to RGB or 7-segment displays as a monochrome matrix can be changed from one to the other simply by 90° rotation. The MAX7219 is best utilised for a "Times Square" display when each register corresponds to a column as horizontal scrolling (the most common sort) can be implemented by shifting whole bytes from one register to another (or more correctly, updating registers at a time) rather than bit-shifting and carrying into and out of eight registers at a time.

I've seen 32x32x32 LED displays on YouTube. How does one drive all of those LEDs - with a bunch of LED driver chips?

OK. You have recommended LED driver chips as the best way to drive LEDs. How does one determine the number of channels to drive an RGB display? Is it 3 channels - one for each color or is it based on the number of columns or the number of rows or both? For example, how many channels would it take to drive a 4x4x4 RGB display? An 8x8x8 RGB display? A 32x32x32 RGB display? How do you do the math?

How many LEDs are you trying to drive? You need to calculate the total amount of current required by the LEDs and then google for a BJT or a MOSFET which supports that current. MOSFETs would be the best, but make sure that you always operate them in the saturation region. Using them in the actie region causes too much of heat to dissipate.

32x32x32 is pretty simple.
32x32 = 1024, so you can have 1024 columns, and 32 layers.
So layer by layer, you drive the pattern you want for that layer, and then use a high current capable transistor to source current into the layer (if you have a current sink for each column, such as TPIC6B595), or to sink current from the layer (if you have a current source for each layer - such as cd74AC164).
There are other chips you can use which have more than 8 outputs as well, or outputs which are individually PWM capable.

I'm confused!

Someone recommended LED drivers. BJT? MOSFET? Saturation region? Active region? I know that BJT & MOSFET are a type of transistor. I've seen LED driver circuits on a board that one can buy. I've googled RGB LED drivers & the ones that Ive seen have multiple channels & if I understand correctly, each color is a channel. So, if I wanted to have a 4x4 matrix, I would need 48 channels (4x4x3(one for each color)). I'm assuming that is the same as DMX(digital multiplex) that is used to control stage lighting. The bottom line is that I want to keep it as simple as possible( you know, the KISS principle). You all have provided me with plenty of answers( thank you), but the more information that you provide, the more confused that I get!

LED drivers in the sense you are discussing is more for higher current parts. You would need 16 for a 4x4 matrix, with 4 more drivers for the 4 layers.
Normanb 20mA LEDs: 32x32, you need 1024 drivers for the individual columns, and 32 more drivers for the 32 layers.
The 1024 would need PWM if you wanted fade/brightness control at each position.
If you don't need PWM, then straight shift registers could be used.

The other question is multiplexing.
For a flicker-free display, you would update the entire display 24 times a second.
Each of the 32 layers would then be on for 1/32 of the 24th of a second: 1/32 x 1/24 = 1.3mS.
1024 bits is 128 bytes. That could be transferred into shift registers in ~150uS at a 8 MHz rate.

What's a layer? Are these some sort of 3d LED displays?

Yes, ralphd, the last couple of posts are about 32x32x32 cubes.

OK. I'd like to change the subject a bit. I've seen a lot of videos on YouTube about driving RGB LED strips with Arduinos. I would think that it would be easier to drive LED strips because they only have 4 leads & they already have control chips. Am I correct or not? I have no idea what the code would be like. I'm retiring at the end of next month & I'd love to get an Arduino or Raspberry Pi or Beaglebone Black & teach myself electronics. When you think about it, creating even a small RGB LED cube requires a lot of soldering. A 8x8x8 RGB cube would require 8x8x8x4(four all 4 leads on each LED) = 2048 solder connections! That's a lot of soldering! And that's just for the cube. Building & soldering all the resistors & ICs & stuff would be time-consuming(Of course, I'll have plenty of time to solder since I'll be retired.) So, would using RGB LED strips be easier to do & save time?

Sure - be harder to put in a cube shape tho. :astonished:

WS2812 -power, Gnd, data in, data out to the next chip.

Sure - be harder to put in a cube shape tho. smiley-eek

I was thinking about criss-crossing the strips horizontally & vertically since the LEDs are about an inch apart or weaving the strips like weaving a basket.

There could be some neat arrangements of the strips, though. Like taking 2 of them & creating a helix & use short strips between the helices to represent the amino acids in DNA. Or create concentric circles or ellipses or spheres or other geometric figures. I was just wondering about a simpler way to drive LEDs with less soldering.

Well using pre-fabbed flexible strips is certainly less soldering.

Note that there are MANY kinds of "led strip", not all of which have individually controllable LEDs...

Note that there are MANY kinds of "led strip", not all of which have individually controllable LEDs...

I've noticed that. I've seen analog strips where none of the LEDs are singly addressable & digital strips where each LED is addressable.

Now, I'm sorry, but I want to change the subject a bit again. It's still about LED drivers. You all have answered many of my questions & because of that I'm understanding LED drivers better. I've also done a lot of googling. I've seen Youtube videos where the narrator explains how to convert a PC power supply into a bench power supply. Simply gather all of the like-colored wires into a bundle. PC power supplies provide positive & negative voltages, but the negative voltages are less than 1 ampere. PC power supplies provide +12v, +5v, & +3.3v which is basically all of the different voltages that you need for your projects. I've wondered which is better - common anode or common cathode. From what I've discovered, common cathode makes more sense to use than common anode. (I'm sure that some will disagree with me.) I read on the 'net that if one wants to use a positive power supply(which I want to use), then one should use common cathode LEDs. I also read that if a negative power supply is used then the numbers for PWM are reversed - 255 is off & 0 is full brightness. That's counter intuitive. I also read that common anode drivers are more common than common cathode drivers. I assume that that refers to the ICs, correct? Well, since I want to use transistors, common cathode or common anode shouldn't make a difference, should it? There are many different kinds of transistors. That's another thing that confuses me. I assume that there's a relationship between PNP & NPN transistors depending on whether it is a common anode or common cathode. Which one is used with common anode - PNP or NPN? Likewise, which is used with common cathode - NPN or PNP? Does it make any difference what type of transistor to use to drive a common cathode LED? I want to keep it simple. I don't want to use inverters or whatever to "convert" common cathode to common anode.

I shouldn't be asking too many more questions.

Not sure precisely what you have been looking at, but in general, we practically never use a "negative power supply", that is, a system with a positive ground.

The computer power supply provides a negative 12V (-5V is no longer available) in case it is required for RS-232 interface cards and some esoteric analog processing cards. For which it is in general, not required nowadays as RS-232 ports are infrequently used - or provided (replaced of course, by USB as used for the current Arduino). So you can most certainly forget about negative (with respect to ground) power supplies, and this has therefore, nothing to do with your choice of LED displays.

As to whether common cathode or common anode displays are more appropriate, the answer is that it does depend on which combination of display and driver IC is more practical given relative cost and availability of each part.

Macnerd:
I've also done a lot of googling.

Too much it seems - getting confused!

Macnerd:
I also read that if a negative power supply is used then the numbers for PWM are reversed - 255 is off & 0 is full brightness. That's counter intuitive.

And probably nonsense. Ergo, too much "Googling"! :smiley:

I think that I've asked almost all of my questions.

I know that LEDs require a certain amount of voltage & current before they will even turn on. Should the driver be constant current or constant voltage or both?

LED drivers that sink current are much more common than those that source current. In that respect a common anode LED is preferred.

Your driver should always be constant current -- not constant voltage. This voltage vs current curve for a diode demonstrates what happens when you're off just a little bit.