1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

LED Dimmer using mosfet

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by fliggygeek, Apr 9, 2011.

  1. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    Hi all,
    I am building a simple LED dimmer circuit using a STP16NF06 FET. It takes input of 0-10v signal that represents the level of the LED, ie 10v == 100% 0v == 0%. The load circuit is 12v at about 1.5 amps. What I would like to know is whether I need a current limiting resistor on the gate of the FET or is it OK to hook up to the 10v? Any other things I should do to the circuit? Sorry no schematic as yet, but all I am doing is running the 10v + signal to the gate, +12v to the load and the - load to the source, drain to gnd of 12v and 10v.
     
  2. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    At 1.5A, the FET will be dissipating ~10W worst case, so you will need a large heatsink!

    What is the forward voltage drop across your LED at full-brightness? Did I get it right; this is a 1.5A Luxeon or other high-power LED?
     
  3. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    no, simply a parralell array of series arrays of 5mm standard leds with a current limiting resistor. Foward voltage drop of ~3.6v per led arranged 3 in series with a 47ohm resistor, then that in parralell to 22 sets of three leds.
     
    Last edited: Apr 9, 2011
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334

    This will do what you asked for:

    You want the current through the leds to be proportional to the control voltage. The maximum forward current for your leds is likely less than 30mA, so I set it up to get 27mA when the control voltage is 10V. Bad news: a supply voltage of 12V is not high enough to get sufficient current at 10V control voltage. The supply voltage must be at least 14V. This is a consequence of putting three leds in series with the 47Ω resistor. Two would have worked with only 12V.

    Look at the sim plots: I(R1) red trace is current through one of the parallel branches as the control voltage goes from 0 to 10V. The Fet source voltage is V(s) light blue. The current being regulated by the opamp is proportional to the drop across the 1 Ω source resistance.

    Note the Violet trace, which is the power dissipation in the FET. It will need a heatsink. The power dissipation in the 1Ω source resistor R2 is the green trace. It needs to be a 1W resistor( not 2w as shown in the schematic)

    The opamp combined with the FET is a voltage to current converter. The Opamp can be a LM324 or LM358, or dozens of others. Your NFET will work in place of the one I simulated.
     

    Attached Files:

    Last edited: Apr 9, 2011
  6. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    OK, that was precisely the sort of information I wanted, I am buying a few bits ;like opamps and resistors in an hour or so to play with.
     
  7. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    Just finished building the setup as you described, works almost perfectly, I am indebted to you. (The almost perfectly bit is just that I dont like the dimmer curve that is produced, but this is a common issue of LED systems so I will just software compensate)
    [video]http://www.facebook.com/v/10150151411583717[/video]

    Reputation awarded to MikeMl for awesomeness
     
    Last edited: Apr 9, 2011
  8. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    There have been several threads on these forums about led dimming and "eyeball perceived brightness". I would appreciate it if you posted a "dimming Curve" that has the appearance of linearity.
     
  9. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    I think the issue you are seeing there is that its not true linearity that is what people really want, they are after a dimming curve that replicates that of an incandescent light curve. Sure, incandescent lights arent linear either, but people are so used to the curve on them that they find it easier to have LEDs conform to that.
     
  10. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    Ok, I have built a full test system for this, with the full number of leds on it and I have an issue where when the input voltage is 0v there is still enough current in the leds that they are lit. What do I need to change to fix this? I have a feeling that its because the bulk lot of leds I bought have a smaller foward voltage. Is it just the current limiting resistor in series with the three leds I need to change for a higher value?
     
  11. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    Is the opamp rail-to-rail output? It is probably not pulling the gate of the FET low enough. An LM358 should work.
     
  12. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    Im using the LM324 just because i wanted 4 in a package, whats the difference between the two?
     
  13. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    LM324 should work fine. Im assuming an enhancement mode NFet. Is yours?
    Check that the voltages at Gate, Source, and Drain are similar to these for low input voltages. Note I added R26. See if that fixes it.
     

    Attached Files:

    Last edited: Apr 14, 2011
  14. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    The extra resistor sets it up properly to be off now, thanks for that
     
  15. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    Hmm, is there any issues you can see about me using the other three channels of opamp on the lm324 for 3 more dimming channels? I have tried and failed every time. Its most odd.
     
  16. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    Are you sure you have the pinout? Post a link to to the data sheet.
     
  17. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
  18. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    Is Pin 4 of the LM324 tied to +12V to +15V? Is Pin 11 tied to 0V (gnd)? Do you have a bypass capacitor (at least 0.1uF) from Pin 4 to Pin 11?
     
  19. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    No bypass cap, but i have done the other two.
     
  20. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,045
    Likes:
    541
    Location:
    AZ 86334
    What are the voltages at the corresponding pins on the channels that dont work compared to the one that does? Gate, source, drain
     
  21. fliggygeek

    fliggygeek New Member

    Joined:
    Apr 9, 2011
    Messages:
    14
    Likes:
    0
    [​IMG]
    Havent got a set of voltages atm, but thats the board in question. 4 fets on the single opamp group.
     

Share This Page