Drive an LED direct from a PIC IO pin (ie no current limiting resistor)


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    What that tells you is that the average Vf (forward voltage drop) of your LEDs is 2.815V [(9-2.59-0.78)/2] at 20mA current draw.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Well, I have to say I'm well confused...these are white leds....have a forward voltage of 3.175V (for 20mA), I can only imagine my DC readings (& my brain) are being put out of whack by using a meter that's not factoring in the PWM (which with a HPWM duty cycle figure of 89, means the voltage is only there 1/3rd of the time)....I need a strong coffee to ponder this one more!

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Ok the issue in the end was embarrasingly simple...I was using a meter that wasn't true RMS, therefore my readings are out of whack.

    I've just ordered up a true RMS multimeter (a uni-t UT61E, mainly becuase the U61D fared reasonably well in this shootout.... *especially* for its 'true RMS' reading ability 42m30s in)
    Last edited by HankMcSpank; - 5th June 2011 at 10:41.

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Ok, a real quickie wrt PWM and this circuit config...



    ...will a high value of duty cycle (eg 255) turn the LEDs on fully (and a duty cycle of 0 turn them) off or vice versa?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    it has to... It's a case by case thing, monitor your HPWM output with a scope. But usually you want to manually turn the PIN HIGH /LOW. Just disable the PWM mode and use HIGH/LOW.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Well I can tell you what's happening in practise (with that very circuit) ....a PWM duty value of 255 turn the leds on bright, a duty value of 0 turns them completely off. But my brain is now frazzled, because I always thought that with 'n' channel fet, with no source/ gate voltage differential (therefore a duty value of 0) a fet will conduct at its lowest RDS resistance .....& to 'cut it off', you need to make the gate more negative.

    But obviously with the above config the the source is at ground, the only way is up so to speak (on the gate...ie if driven by a PIC) ..therefore no possiblity of turning the n fet off.....which bit am I not grasping?!

    I removed the PIC (so the gate was floating) & the leds remained on (which is kind of what I expect)

    Brainache.

  7. #7
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Well this clarifies how an n-channel mosfet will work



    but it doesn't go into detail.

    I'm making a (bad) assumption) that an n channel mosfet, will work in a similar fashion to a jfet (which I've used prior...mosfets never)...with jfets, you have to make the gate negative wrt to the source to cut them off....hey ho, I guess that why a jfet is called a jfet & a mosfet is called a mosfet....different devices...no workee the same.

  8. #8
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: Drive an LED direct from a PIC IO pin (ie no current limiting resistor)

    Quote Originally Posted by HankMcSpank View Post
    ....to 'cut it off', you need to make the gate more negative.

    But obviously with the above config the the source is at ground, the only way is up so to speak (on the gate...ie if driven by a PIC) ..therefore no possiblity of turning the n fet off.....which bit am I not grasping?!
    Look up the Vgs parameter (and the typical transfer characteristics graph - IRF8714 in the example below) in the datasheet of a MOSFET for the answer.
    Attached Images Attached Images  
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

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