Hi. Thanks for your most comprehensive post.

Right, that's what I was looking at after I was taught about the

unreliability of beta. I was thinking of using a zener with emitter

follower, or possibly a bona fide linear regulator IC, to lower the

PWM voltage. But I'm not sure if they're suitable for fast switching.

(Although I don't need to PWM all that fast, just faster than the

human eye can see.)

Oh, definitely. This is for an illumination device that is meant to be

used in room temperature, and I hope to avoid too much heat generation

in the circuit itself.

Just let me see if I decipher the circuit correctly:

This, I gather, is a PNP version of the feedback-based current

limiter. When PWM is low, Ic is limited to (Vcc-Vbe)/R3.

And this is a current mirror which ensures that Ic(Q3) = Ic(Q4). I

don't yet have a full intuition of how it works, but I recognize the

shape.

Indeed I do. The idea is to have enough leds to provide some visible

illumination, and since as a beginner I'm not comfortable with dealing

with voltages over 12 V, I'm going to need quite a number of LED

series. That's why I wasn't very comfortable with the idea of using a

regulator or op-amp for each series. They'd get expensive relative to

the cost of the LEDs.

Your solution requires only a single transistor per series, not even a

resistor. I still need to figure out how this "amplified current

mirror" works, and I haven't yet had the chance to try it out, but at

least on paper it seems quite optimal. Thanks again.

So let's look at a revised (I renumbered the parts) version

of the last circuit, which can handle several series chains

of LEDs all operating at the same current:

: Vcc +V +V

: | | |

: | | |

: | --- ---

: | \ / Dan \ / Dbn

: \ --- ---

: / Rset | |

: \ | |

: / . .

: | . .

: | . .

: | more more

: | LEDs LEDs

: Q1 | here here

: |<e Vcc . .

: PWM-----| | . .

: |\c | . .

: | | . .

: | | | |

: | Q3 | | |

: | |/c --- ---

: +---| \ / Da1 \ / Db1

: | |>e --- ---

: | | | |

: | | | |

: | | | |

: Q2 c\| | |/c Qa |/c Qb ... Qz

: |---++--| ,--|

: e<| | |>e | |>e

: | | | | |

: | | | | |

: | | | | |

: | | | | |

: | | | | |

: gnd | gnd | gnd

: | |

: '---------+------- ... Qz

Here, you can see that I've numbered Q1 to Q3 as the unique

BJTs where you only need one of each no matter the number of

added series chains. Qa to Qz would be chains up to 26.. but

in reality it will be the number of series chains you need to

apply. The LED series chains are numbered, accordingly, and

have up to N in them (limited by the available rail voltage,

+V, divided by the required LED voltage during operation.) I

gather you already know all this stuff, so I won't belabor

it. You mainly want to understand Q1 to Q3, the first Qa, and

Rset. (And already understand some of that, anyway.)

So, yes. Q1 and Rset determine the current. When your PWM

drive goes to 0V (or very close to it), Q1's emitter will be

about a diode drop above. I'm going to assume about 20mA per

chain here. So this means that Q1's collector will need to

source 20mA. Since I figure 0.7V for a collector current of

2mA, this means the Vbe of Q1 will be about 60mV more, or

760mV. That's the likely collector voltage when driven ON. So

the current through Rset will be (Vcc-760mV)/Rset. It's

reasonably predictable, so you can use it in a design. The

main caveat here will be that Q1's Vbe will drift over

temperature at about -2.1mV to -2.3mV (from memory.) So if Q1

warms up 20C, let's say, this amounts to a change of say

45mV, meaning the current will be (Vcc-715mV)/Rset. That's

probably the most you have to worry about here. Other than

that, you can predict it pretty well.

Q1's sourcing its collector current into Q2. (If Q3 were

removed and Q3's base jumpered to its emitter in the empty

socket, the circuit would still work. So let's look at that,

first, and ignore Q3 for now.) In this case, Q1's collector

will be positive enough to turn on both Q2 and Qa (we'll

ignore the other chains, for now, too.) But Q1's collector

current must go through Q2's collector, with only a slight

amount of that current (set by Rset) diverted to provide the

base currents of Q1 and Qa. So most of it.

Let's pause a moment. I'm sure you recall one of the BJT

equations:

1. Ic = Is * ( e^(Vbe/(kT/q)) - 1 )

The "1" value there is jiggered in so that Ic goes exactly to

zero when Vbe is zero. Just accept it. It's a model. The

value of kT/q at room temp (20C) is about 25.25mV (you can

compute it yourself on google, entering:

2. k*((273.15+20)kelvin)/(charge of electron)

Normally, the value of e^(Vbe/(kT/q)) is so large in the

active mode, that the value of "1" in the equation can be

ignored. This makes it easier to isolate Vbe, into:

3. Vbe = (kT/q) * ln( Ic/Is )

(If you haven't already figured it out, a BJT uses a base

emitter voltage to determine collector current, not a base

current... the base current is a side effect due to charge

recombination which just happens to luckily slew around with

collector current in mostly lock-step form.)

So now you can see something here. You can figure out Q2's

Vbe from its collector current, Ic, using equation 3. Since

the collector current is set by Rset, driven into Q2 by Q1,

then Q2's Vbe will be set by that current. Now, Q2's base

voltage will be applied to Qa's base and equation 1 will

apply to Qa, causing it's collector current to "mirror" the

driven collector current of Q2. Kind of nifty, eh?

So, in short, Q1 forces a current into Q2 causing it's base

to attain a set voltage above its emitter, which then drives

the base of Qa (whose emitter is at the same place as Q2's),

which then determines Qa's collector current.

Now for the problem. Both Q2 and Qa do require some base

current. It's not much, but it takes away from Q2's collector

current. If you only had Qa, you could probably live with it.

But if you add more chains, each additional base current

starts to add up. So how to remedy this? Stuff in Q3. Q1's

collector will now have to also turn on Q3 (with a Vbe

voltage, of course, in order to get Q2's base turned on. Q3

does require a base current for this, so Q2's collector

current will be diminished by this. However, Q3 is only

supplying base currents for Q2 and Qa to Qz, so it's base

current won't be very much (Q3's collector and base currents

added together supply the required base currents of Q2 and Qa

to Qz, and it's base current will divide that by its beta.)

Adding additional Qb, Qc, and so on increases the sum (or the

required collector current of Q3) but this increase is barely

felt on Q2's driven collector current because it's effect is

divided by Q3's beta. This is a much better situation and

means that you really don't have to worry about adding more

chains to the circuit.

The current mirrors can work down into near saturation. The

main thing is that you know, a priori, that you have enough

+V to operate your LEDs at the desired set current.

A neat thing about a current mirror, by the way and if you

recall my earlier comment about temperature affecting Vbe, is

that the mirror BJTs are all operating at the same collector

currents and roughly speaking at the same Vce (except for Q2,

sadly.) So they all dissipate the same power, roughly, and

heat up about the same. (You could also make them thermally

coupled.) So their Vbe will drift about the same over

temperature changes, and this means that their collector

currents won't budge much from the design.

One idea that is sometimes applied in cases where wasting the

same LED current on Q1 and Q2 (means that if you have 5

chains of LEDs, each at 20mA, you are using 120mA from the

supply with 20mA of it NOT going to LEDs), is that you can

stuff a resistor into the emitter to ground leg of Q2. Then a

lesser current into its collector will jack up its base

higher, causing Qa's collector current to "imagine" that it

should provide more current than is being sunk by Q2. This

causes other problems (temp drift) and there are limitations.

But you could certainly consider the idea of dropping your

Rset current downward to 2mA, for example, using a factor of

10 multiplier (which means you need a Q2 emitter resistor

that drops 60mV at 2mA, or a value of 30 ohms at a guess.)

You could experiment there, if you want to.

Jon