OK, look - if you know the voltage is going to be pretty stable, your best bet would be to take that 24v, subtract 1v from it, and divide the result by the typical Vf of your LEDs at their specified current.
For example:
Let's say you're planning on using a number of white LEDs that have a typical Vf of 3.5v @ 25mA
24v-1v = 23v; 23/3.5v = 6.57... Take the integer value, which is 6. That's how many 3.5v LEDs you can have in a series string.
6 * 3.5 = 21v. So, you have 3v left to drop across a resistor.
The question is now, what size resistor do you need to drop 3v when you have a current flow of 25mA?
R = E/I, or Resistance(Ohms) = Voltage / Current
R = 3v/25mA = 3/0.025 = 120 Ohms
Let's check to see how much power will be dissipated across the resistor.
P = EI, or Power(Watts) = Voltage * Current
P = 3 * 0.025 = 0.075 Watts, or 75mW. We double the wattage to make sure it'll be reliable, so 150mW. You could use 1/4W resistors. 1/8 W resistors would be pushing your luck, as they can only dissipate 125mW.
So, let's look at total power dissipation in the circuit.
75mW in the resistor
21v * 25mA = 525mW in the six LEDs in a series string.
525mW + 75mW = 600mW. 525mW/600mW = 87.5% efficient.
Parts count per string: 6 LEDs, one resistor. It doesn't get a whole lot more simple than that.
Let's look at the other scenario with the regulator.
You're starting off with 3 LEDs per string, plus two resistors and a transistor. There's a fixed "overhead" for the strings of one LM317 regulator.
The regulator is really being used as a current regulator in this case - so you'll have a minimum 1.7v drop across it, plus the drop across Rsense, which in this case would be:
R = 1.25/DesiredCurrent = 1.25/0.025A = 50 Ohms
E = IR (Voltage = Current * Resistance, so 25mA * 50 Ohms = 1.25V drop
1.7v+1.25v=2.95v, hence the standard line that in current regulation mode, the LM317 drops 3v across itself.
So, the three LEDs drop 3.5 * 3 = 10.5v across themselves.
This means that the LM317 drops the remaining 24v-10.5v=13.5v across itself.
P=EI, so the LED's power consumption is 10.5v*25mA= 262.5mW
The remaining power dissipation is 13.5*25mA=337.5mW
Total power dissipation is therefore 600mW, with efficiency of 262.5mW/600mW= 43.75% efficient.
Relatively complex, relatively inefficient, and no guarantee of better regulation - actually, regulation will be worse unless all LEDs used have the same Vf.
You might think you could use six LEDs in a series string - but then you would not have enough "overhead" for the regulator to properly regulate.
There isn't a good point to use a current regulator in your circuit, because you already have a voltage regulator. All you need is a current limiter, calculated as I did in the first example.
For example:
Let's say you're planning on using a number of white LEDs that have a typical Vf of 3.5v @ 25mA
24v-1v = 23v; 23/3.5v = 6.57... Take the integer value, which is 6. That's how many 3.5v LEDs you can have in a series string.
6 * 3.5 = 21v. So, you have 3v left to drop across a resistor.
The question is now, what size resistor do you need to drop 3v when you have a current flow of 25mA?
R = E/I, or Resistance(Ohms) = Voltage / Current
R = 3v/25mA = 3/0.025 = 120 Ohms
Let's check to see how much power will be dissipated across the resistor.
P = EI, or Power(Watts) = Voltage * Current
P = 3 * 0.025 = 0.075 Watts, or 75mW. We double the wattage to make sure it'll be reliable, so 150mW. You could use 1/4W resistors. 1/8 W resistors would be pushing your luck, as they can only dissipate 125mW.
So, let's look at total power dissipation in the circuit.
75mW in the resistor
21v * 25mA = 525mW in the six LEDs in a series string.
525mW + 75mW = 600mW. 525mW/600mW = 87.5% efficient.
Parts count per string: 6 LEDs, one resistor. It doesn't get a whole lot more simple than that.
Let's look at the other scenario with the regulator.
You're starting off with 3 LEDs per string, plus two resistors and a transistor. There's a fixed "overhead" for the strings of one LM317 regulator.
The regulator is really being used as a current regulator in this case - so you'll have a minimum 1.7v drop across it, plus the drop across Rsense, which in this case would be:
R = 1.25/DesiredCurrent = 1.25/0.025A = 50 Ohms
E = IR (Voltage = Current * Resistance, so 25mA * 50 Ohms = 1.25V drop
1.7v+1.25v=2.95v, hence the standard line that in current regulation mode, the LM317 drops 3v across itself.
So, the three LEDs drop 3.5 * 3 = 10.5v across themselves.
This means that the LM317 drops the remaining 24v-10.5v=13.5v across itself.
P=EI, so the LED's power consumption is 10.5v*25mA= 262.5mW
The remaining power dissipation is 13.5*25mA=337.5mW
Total power dissipation is therefore 600mW, with efficiency of 262.5mW/600mW= 43.75% efficient.
Relatively complex, relatively inefficient, and no guarantee of better regulation - actually, regulation will be worse unless all LEDs used have the same Vf.
You might think you could use six LEDs in a series string - but then you would not have enough "overhead" for the regulator to properly regulate.
There isn't a good point to use a current regulator in your circuit, because you already have a voltage regulator. All you need is a current limiter, calculated as I did in the first example.