Controlling LEDs with Arduino

Hey all,

I want to control simple 3mm LEDs using Arduino pins (one led per pin). I want the LEDs to be lit quite bright (around 15mA per LED, too much for the Arduino pins to provide). I also want to be able to control their brightness (using PWM).

How do I do that? What I'm currently thinking is using a MOSFET, or a NPN transistor. I've never used NPN transistors before, so I don't know how to use them.

If I use a MOSFET, do I need to use a MOSFET driver? Or is an Arduino pin with a series resistor good enough to drive the MOSFET?


15 mA per pin is fine for Arduinos using ATmega chips. With resistor of course. :roll_eyes:

The ATmega328 has a limited number of PWM pins. And there is a limit for current per 8-bit port.

There are PWM LED driver chips available. Just how many LEDs do you want to control?

I'm thinking just a couple (like 5 or so).

Yes I have one of those chips on a breakout board. I have a TLC5947 module. I think that's overkill for what I'm currently thinking (just a couple of LEDs). But you are right; the issue is the limited number of PWM pins on the Arduino.