Circuit Check Please (LED driver)

ledraspberry pitransistors

So im Building a project these leds will be arranged in a circle there will also be about 15 more of these. with inputs to activate them the 3.3 volts will be from a raspberry pi gpio pin. The 12v sorce is a power supply to light all the leds that ill be using. Just want someone to look over this before i buy everything. to double check me and also help me find the value of the Resistor on the 3.3v for the transistor. Each Led in this will be blue.

Led forward voltage is 3.8v and they are all 20ma

Transistor is a TIP120

Thanks for you help

Best Answer

There is a big problem with this circuit - the \$V_{CE(sat)}\$ of the TIP120 is 0.7V at ~100mA (near our operating point).

TIP120 Vce(sat) vs Ic

That means that there will only be \$12-0.7 = 11.3V \$ across each LED string. Since \$3\times3.8=11.4V\$, this means you won't quite have enough voltage available to power the 3-LED strings. Bummer.

Never mind, we can fix this. Since the total current through the three strings is only around 60mA, we don't need a Darlington transistor like the TIP120 - we can do it with a standard NPN BJT. Let's choose the BC547 (because it's readily available and has a maximum collector current of 100mA - enough for us). It's \$V_{CE(sat)}\$ at 60mA collector current is 0.1V - much better.

BC547 Vce(sat) vs Ic

So now we have 11.9V across each LED-string + resistor combo. Therefore, the current through each 3-LED string is \$(11.9-(3\times3.8)) \div 33 = 15mA \$. Current through each 2-LED string is \$(11.9-(2\times3.8)) \div 220 = 20mA \$. This means that the two sets of LEDs will have different brightnesses. If you want to match them better, make 3x 3-LED strings and just don't use one of the LEDs. You can reduce the resistors to get your forward current back up towards 20mA per LED if you want.

Now, let's calculate the base resistor. We want the BJT in saturation mode, which means we want \$I_C << I_B \times H_{FE}\$ - that is, we want to overdrive the base current a bit. if we set them to equal, that gives \$(2 \times 15mA) + 20mA = I_B \times H_{FE}\$. We look up \$H_{FE}\$ from the datasheet:

BC547 DC electrical characteristics

We see it given as minimum 110 (worst case). So \$(2 \times 15mA) + 20mA = I_B \times 110 \to I_B = \frac{(2 \times 15mA) + 20mA}{110} = 0.45mA \$. But actually, as said, we want to overdrive it to ensure saturation - let's overdrive by a factor of 5 (still well within the maximum base current specified in the datasheet). So \$I_B = 2.3mA\$, and we know that \$V_{BE} \approx 0.7V \$ (one silicon diode drop). So \$I_B = 2.3mA = \frac{3.3-0.7}{R} \to R=\frac{3.3-0.7}{2.3mA} = 1130 \Omega\$. The nearest E24 value is \$1.1k\Omega\$ - so use that. And we're done!

The big takeaway point from this is not to neglect the voltage across your "switch" device - it's always going to be there, and if you're running close-to-the-wire in terms of voltage overhead for diode-type devices, you need to be sure you're not throwing away voltage you can't afford. The minor takeaway is that Darlington transistors come with drawbacks - higher \$V_{CE(SAT)}\$ and also a higher \$V_{BE}\$ - but we didn't get on to that in this answer. The Darlington transistor Wikipedia page covers the basic difference - worth a read.