Can I drive a 5v LED without a current resistor?


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    55


    Did you find this post helpful? Yes | No

    Default

    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)

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If your program logic allows you to do, you can pulse it or pwm it at or below its operating voltage.
    Even with a very short duty-cycle, you're still over-driving the PIC output pin, and the LED
    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 assume a 5v LED would have a built in resistor as standard LEDs are around 2v.
    I wouldn't assume the LED had a built-in resistor. I would check the data sheet for the LED
    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}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    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
    Same technique used in this very versatile project; http://members.cox.net/berniekm/super.html

    I have built this, and been using it for a couple of years with no problems either to the pic, or the display.

    Regards,

    Anand Dhuru

  5. #5
    Join Date
    Feb 2007
    Posts
    55


    Did you find this post helpful? Yes | No

    Default

    I dispensed with the Common Anode Resistor in each display saving two Resistors
    wouldnt having the resistor on the common anode cause you to get different brightness for different digits?
    ie 8 would be dimmer than 1 as the current would be split between 7 segments to display 8, and only 2 segments to display 1.

    i normally put the resistors in series with each segment, and use a transistor on the common pin

  6. #6
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    In theory, yes, but in practice I find no discernible difference displaying a '1' or an '8'. For the purists, the URL I gave for the Superprobe drives *each* segment at a time.

    Anand

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No, you're not thinking this 7-segment thing through...

    Only ONE segment is ON at any instant in time. Assign a letter to each segment, 'a' thru 'g'. Each of those segments is allowed to be ON only for 1mS in any period. Now my period time was 15mS, but let's say for examples sake you have a 7mS Period. The first segment ('a') will illuminate only for the first 1mS of any period. The second segment ('b') will illuminate only during the second mS of the 7mS period. The third segment ('c') is only allowed to illuminate during the third mS of the period... and so on. So each segment gets it's own single mS all to it's-self and is the ONLY segment that is switched ON during that particular mS.

    So in a 7mS cycle divided into 1mS segment periods, a number one (which might have segments 'a' and 'b' illuminated) would have the cycle...

    OnA-OnB-OffC-OffD-OffE-OffF-OffG

    So in that 7mS cycle, only ONE segment is illuminated at any time (and then for only 1mS).

    If you want a Resistor, then a single Common Anode (or Common Kathode) Resistor is fine. It only ever has to cope with ONE segment being illuminated and the brightness is constant.

    Your eye will not distinguish the flicker and the display will appear constantly (and consistantly) illuminted regardless of the number of segments displayed - but if you film the display with a video camera, you will then notice the flicker because the refersh rate of the camera will not the the same as that of your display and you will observe a strobe effect.

    There is a SECOND AND VERY BIG ADVANTAGE to this technique... if you want to display '1' or '8888' the current consumption will be the same (that for ONE segment - say 10mA). Go display '8888' on a quad 7-segment display using the usual amateurish sloppy techniques of switching all the segments ON that you want at the same time and tell me how much current you pull... (7 segments, multipled by the number of digits, multiplied by say 10mA for each segment...). 7 x 4 x 10mA = 280mA... I've had so many laughs at some of the schematics and coding that I've seen for 7-segment displays...

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 07:14
  2. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 05:59
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 21:19
  4. Led + resistor ?
    By ruijc in forum General
    Replies: 7
    Last Post: - 10th March 2008, 21:33
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts