Arduino with multiple RGB LEDs

Hi, I am pretty knew into the Arduino world. My problem is trying to make multiple RGB leds ( work with the Arduino. Although it would be be easy enough to use a single RGB led, I want to use multiple RGB leds. My RGB led uses 3 digital pins with pwm but since i am using an arduino pro micro with 5 pwm pins, I can only use 1 led. I have found that the max current per pin is 40ma but shouldn't exceed 20ma so therefore you couldn't put 2 leds. So my question is, how would i power more than 1 RGB led? Any help will be appreciated. Thanks!

sort by: active | newest | oldest
Anshu AR8 days ago

Hi Isaac Emery,

If you are just concerned with the power consumption of LEDs you can use transistors or MOSFETs for powering your LEDs.

I've used transistors for controlling a bunch of LEDs and even motors lately and never had any issues.

You can use this guide to power your LEDs. Just add the LEDs instead of the motor in the schematics. Finally, use PWM pins to control brightness.

Hope that helps :)


very well explained

Keep in mind the amount of heat that little TO-92 plastic transistor is going to have to reject in less space then your pinky finger nail... And then switch to a cooler MOSFET which can do a better job !

Isaac Emery (author)  Anshu AR6 days ago

thanks. This really helped me. Just one more question, what is the max current for the 2N2222 transistor that you used in your motor project. Thanks!

Hi Isaac Emery,

The maximum current that a transistor can withstand can be found in the datasheet.

Now according to the datasheet of 2N2222, the transistor can safely provide a current of 500mA through the collector. (When a 500mA of current is passing through collector the DC current gain factor decreases to 40.) So, a current of 12.5mA is required at the base.(In your case this will be provided by the Arduino.)

Now, although datasheet mentions 500mA usage safe personally I would not use 500mA. So, consider safety gap and use about 400-450mA safely.