TTL/CMOS outputs driving leds

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I've read that TTL/CMOS outputs shouldn't drive LEDs directly but using a transistor, but I've seen in many projects LEDs directly connected to the mcu port, ¿in which cases should I use transistor and in which not?

On the other hand if I connect the led without the transistor, do I need a resistor?

Thanks!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes you definitely need a resistor.

Back when dinosaurs ruled the earth, TTL outputs were weak, could only sink enough current to drive a LED, CMOS chips did not exists and LEDs took 20mA of current.

Today's micros have hefty output buffers and can easily drive about 10mA to a LED, either by sinking or sourcing current.

edit: okay, there is a limit - you cannot for example drive 20 leds at 10mA each, there are current limits per pin, current limits per pin group like single port, and current limits per power supply pin. In these cases you do need a transistor.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks a lot, your answer is perfect !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

On the other hand if I connect the led without the transistor, do I need a resistor?

No if. You need a resistor in series with the LED in both cases. Or some other current limiting device.

The exception is LEDs that have a resistor built in. Which, come to think of it, is not an exception at all.

If you think education is expensive, try ignorance.