1
\$\begingroup\$

I'm trying to control a handful of LEDs via Raspberry Pi Pico, on a single GPIO pin.

I've wired up 14 LEDs in parallel, each with it's own resistor (330 Ohm, 0.5 Watt). Combined, the LEDs need to pull 420mA, with input of 3.3V and a forward voltage drop of 2.65V.

I want to use only [email protected] (no greater than this) from a single GPIO pin for a control (base) input to a transistor, with the power source (collector) connected to +5V. These requirements are non-negotiable, but I have no idea what other components I will require to make this happen (I'm trying to learn how to pick the correct, presumably NPN, transistor and appropriate resistor for between the power source and the collector).

I don't care about, or require, filtering as the load being driven is LEDs.

I'd appreciate either a specific transistor/resistor pair recommendation, or at least a concise explanation as to how to determine these parts. I'm okay at reading data sheets, but there's more to transistors than my understanding at this time.

link to the LED part from digikey: https://www.digikey.com/en/products/detail/kingbright/WP710A10LVBC-D/5177415

\$\endgroup\$
4
  • \$\begingroup\$ It looks like you want 30 mA per LED. If so, please show us your math to justify a 330 ohm current limiting resistor. Also, can the output be 3.2 V? If yes, than an emitter follower as the driver will work with no resistor in the collector. Another approach - can the LEDs run off of the 3.3 V source, ot do they have to use the 5 V source? \$\endgroup\$
    – AnalogKid
    Apr 17 at 3:43
  • \$\begingroup\$ I know the right answer would have been to use 22 Ohm limit resistors on the LEDs, but I had a brain-fart when I was ordering the parts, the LED datasheet listed the Forward Voltage for when I_F=2mA (later on lists DC Forward Current as 30mA) which I plugged in to an online calculator and got 330 Ohms out the other side. I've tested, and can light them up with 3.3v from a dedicated supply. I'm planning to feed the transistor Collector off the VBUS pin (5v) from the Pi, which comes right off the USB jack. As long as the emitter output is ≥2.65v the LEDs should still light, I believe. \$\endgroup\$ Apr 17 at 4:06
  • \$\begingroup\$ Can you use two transistors? I think the current gain is a bit much for one BJT (may be borderline, maybe your pile has some that can do it and some that can't)... although a MOSFET can easily achieve it (as they mostly take 0 current from the GPIO when used in an application like this). Does transistor have to mean BJT or do you also count MOSFETs? \$\endgroup\$
    – user253751
    Apr 17 at 14:42
  • \$\begingroup\$ I'm agnostic and indifferent as to what type of transistor (bipolar junction, or fet), but would prefer single transistor to multi because it makes my overall circuit easier to understand. The entire project is going to be released under PPL license, the intended end users are unikely to have even as much electronics background as myself. I'm hoping it becomes a gateway for some to get into electronics as a side effect. \$\endgroup\$ Apr 17 at 19:17

1 Answer 1

10
\$\begingroup\$

With collector tied to any positive supply (over 3.3V, such as 5V or 12V even), and with load at the emitter, that configuration is an emitter follower, and the output potential \$V_{OUT}\$ (at the emitter) will be \$V_{OUT} = V_{IN}-0.7V\$.

This means that your GPIO potential of 3.3V can never produce more than \$V_{OUT} = +3.3V - 0.7V = 2.6V\$. That is also non-negotiable, and this configuration cannot possibly work for your LEDs, regardless of what resistor you use.

You must use common emitter, with emitter tied to ground.

With that configuration, and a saturated transistor dropping \$V_{CE}=0.2V\$ (worst case), each resistor/LED has \$5V - 0.2V = 4.8V\$ across it. Using 330Ω resistors and 2.65V LEDs results in a collector current (for each) of \$I=\frac{4.8V-2.65V}{330\Omega}=6.5mA\$

The collector current for 14 LEDs will be \$14 \times 6.5mA \approx 90mA\$.

Any common signal transistor should do, but just to be sure we should consider current gain \$\beta\$. For a GPIO sourcing at most 3mA, you require a transistor with current gain \$\beta = \frac{I_C}{I_B} = \frac{90mA}{3mA} = 30\$ (or more).

A signal transistor's current gain \$\beta\$ is typically over 100, but we can assume a worst case of \$\beta=50\$. The minimum base current required to saturate the transistor will be \$I_B=\frac{I_C}{\beta}=\frac{90mA}{50}=1.8mA\$. That's less than your constraint of 3mA maximum, so we're good.

Also, for completeness, check the transistor's power dissipation, just in case: \$P=I\times V = 90mA \times 0.2V = 18mW\$, which is well within any transistor's capability, without heat-sinking.

Since the transistor's base will be clamped to 0.7V maximum, you can't tie the GPIO directly to it. When the GPIO output is high, there will be a difference of \$3.3V-0.7V= 2.6V\$ to span with a resistor, which should pass 1.8mA. That's a resistance of \$R=\frac{V}{I}=\frac{2.6V}{1.8mA}=1.4k\Omega\$. Erring on the side of caution (slightly more base current is OK), round down to the nearest E12 value, for a base resistance of 1.2kΩ. You could round up to 1.5kΩ, it's very unlikely that the transistor will have a gain of less than 100, so it's pretty safe to work with slightly less base current too.

All that implemented:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.