35mA led with 25mA pic output?


Results 1 to 34 of 34

Threaded View

  1. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    I understand i should use the 5v power supply with a 82 ohms limiter and switch led with a transistor in order to have full brightness but i do not wish to add a transistor. I should then either choose an inline current limiter and chose the adequate value for let's say 20mA and have a dimmer led or get a 10mA led.
    Okay, thanks all for your answers.
    Find the datasheet for your particular LED...
    Look up 'Forward Voltage'...assume it's 1.5v for example.
    Now look up 'Current'...assume in this case it's 35mA, 'cause that's what you said it was
    And you're driving the LED from a PIC pin at 5V

    The LED will 'drop' 1.5v across it 'cause it's a diode and that's just the way they are...
    So, that leaves you with 3.5v to work with.
    The LED wants 35mA (.035A)

    Ohms Law - I=V/R, V=IR, R=V/I
    R (ohms you need) = V (volts, 3.5V) / I (35mA)
    R = 100 ohms...
    But that'll allow up to 35mA per PIC pin, over the limit...but you're driving the LED from 2 pins (unless I misunderstood).
    So, R = 200 ohm across each PIC pin will give you 17.5mA from each pin, paralleled to the LED.

    But I gotta tell you, it'll work, but it's not 'the way to do it'. The right way to do it is to add an external transistor or MOSFET to turn the LED on or off.
    Or you could just increase the resistor value and use one pin... Like you said, the LED will be dimmer.
    Last edited by skimask; - 24th October 2008 at 18:37. Reason: Changed 50 ohm to 200 ohm....Thank Nicmus if you don't blow a pin on a PIC :D Good catch...

Similar Threads

  1. comp music with pic Sounds - Aka BeepMaster
    By flipper_md in forum Code Examples
    Replies: 18
    Last Post: - 20th September 2010, 06:04
  2. Calulating BJT base resistance for PIC led switching?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th November 2008, 08:41
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. Capacitor on PIC output
    By Michael in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st March 2008, 19:10
  5. PIC16F877A PAUSE command
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 12th December 2006, 01:40

Members who have read this thread : 0

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