I am driving an RGB LED using an MCU. However, maximum current output for the MCU is 50mA which is less of what 3 LEDs require (RGB).

What is the simplest way to let the LEDs to draw current from an external power supply while yet being PWMed from the MCU?

  • 1
    \$\begingroup\$ The LEDs are unlikely to actually "require" that much current, unless it's one of those large multiwatt RGB LEDs. \$\endgroup\$ – Ignacio Vazquez-Abrams Feb 25 '14 at 19:01
  • 1
    \$\begingroup\$ With a transistor. \$\endgroup\$ – John U Feb 25 '14 at 19:15
  • \$\begingroup\$ Can you provide any specs for the led? Maybe it's a 3w led that requires about 3.4v and the emitter follower as shown in the linked reply doesn't apply. \$\endgroup\$ – alexan_e Feb 25 '14 at 19:21
  • \$\begingroup\$ What is the MCU ? Arduino ? \$\endgroup\$ – FredP Feb 25 '14 at 19:24

Depending on how much current your LEDs need individually and how many volts your external power supply is, there are different methods. The simplest (and possibly most common) method assumes that your power supply is about 5V and your LED forward voltage when conducting is something less than 4V. You can then use an NPN transistor driven via a 1kohm (maybe less, maybe more) to its base from the MCU pin. The emitter would be connected to 0V and the LED connected in series with a current limiting resistor to 5V.

The current limiting resistor is calculated as follows: -

R = \$\dfrac{5V - V_{LedForward}}{I_{LED}}\$

If LED current is 50mA and forward voltage is 3V then R = 40 ohms.

Obviously you'll need three of these circuits, each for R, G and B.


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