Can I drive a 5v LED direct from an I/O pin (without a current resistor) or do I have to have a current resistor to avoid problems?
MCU: 18F2550
Can I drive a 5v LED direct from an I/O pin (without a current resistor) or do I have to have a current resistor to avoid problems?
MCU: 18F2550
For a standard LED, use the series limiting resistor. If you're short on space, you
can find LEDs with built-in current limiting resistors.
If your program logic allows you to do, you can pulse it or pwm it at or below its operating voltage.
------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
I assume a 5v LED would have a built in resistor as standard LEDs are around 2v.
Just need to check the datasheet to make sure that the current flow of the LED is within the PIC limits (normally 25mA)
Some of my projects: http://www.youtube.com/user/wellyb00t
Even with a very short duty-cycle, you're still over-driving the PIC output pin, and the LEDIf your program logic allows you to do, you can pulse it or pwm it at or below its operating voltage.
during peak-pulse times. I for sure don't recommend you do this without the series resistor
when directly driving the LED with a PIC output pin.
With a transistor driving the LED, you may be able to get away with high peak-pulsed
current levels, for short durations, but I would never try this directly driving the LED from
the PIC output pin.
I wouldn't assume the LED had a built-in resistor. I would check the data sheet for the LEDI assume a 5v LED would have a built in resistor as standard LEDs are around 2v.
first. If you have an LED with a forward voltage drop of 2V, and a MAX forward current of
10mA, then just subtract 2V from 5V for the working voltage, then /10mA to find the series
resistor value.
I.E. 5V - 2V = 3V / 10mA = 300-ohm series resistor you'll need to operate the LED at 5V
with 10mA current through the LED.
What if you need to operate this same LED with a 12V supply? Same thing applies. 12V -2V
= 10V. 10V / 10mA = 1K. So you just pop in a 1K resistor. Most LEDs don't care what the
voltage is, you just have to limit current through the LED at whatever voltage you're using.
Now, if you want to use PWM to dim or brighten the LED, your peak-pulse current levels will
not exceed the LED max DC current levels during the peak-pulse periods.
If you drive the LED with a 50-50 PWM duty cycle, your time average current will be
50% of 10mA, but your peak-pulse-current will still be the full 10mA.
If you exceed the MAX drive levels for the PIC or LED, even for brief periods, you can
pretty much count on failure at some point.
Seems pretty silly when you could have prevented total failure, or degredation over a
period of time with a 1-cent resistor...;o}
I have a design in which a PIC drives two seven-segment displays directly. No segment is ON more than 1mS in any 15mS period (allowing all 14 segments and the Decimal Point to be cycled across 15mS). I dispensed with the Common Anode Resistor in each display saving two Resistors on the Basis that having the LED ON for only 6% of the time was an acceptable risk (with the advantage of a brighter display) and the product was unlikely to fail within the warranty period. It wasn't the cost, but the labour in their insertion that was the consideration in a cheap $20 product. 25,000 sales across six years with zero returns - I can live with that.
If it's truly a 5V LED it will have a current limiting resistor built in like this one...
What interests me more is WHO ON EARTH is willing to pay $1.25 for a single LED...
Show me these guilty people (so I know who I can deal with)...
Well, that was just a quick example I googled up. You can find them for less.And the OP didn't ask whether they were cost efficient but only whether they needed an external resistor.
- http://www.mouser.com/Optoelectronic...5v+led&FS=True
http://www.maplin.co.uk/Module.aspx?...&ForceUpdate=Y
They are really handy for breadboarding - as long as you don't mix them with standard LEDs.
Last edited by dhouston; - 11th September 2009 at 14:47.
Bookmarks