Author Topic: Creating a constant current for powering LEDs  (Read 1701 times)

0 Members and 1 Guest are viewing this topic.

Offline sean87Topic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: nl
  • EE WannaBee
    • EMBEDONIX
Creating a constant current for powering LEDs
« on: September 23, 2017, 03:34:02 pm »
I want to create a 3 luminance step light using a mosfet and output of a DAC of a micro (DAC can output 0 to 5V). I am thinking about a jelly bean N-FET (2N7002) but the simulation plays a game on me. Any ideas what can be wrong? I get the same output current after I pass the Vgsth (LTSpice file is also attached).

EMBEDONIX - Embedded Systems, Linux and good stuff!
 

Offline BenKenobi

  • Regular Contributor
  • *
  • Posts: 86
  • Country: gb
Re: Creating a constant current for powering LEDs
« Reply #1 on: September 23, 2017, 03:57:27 pm »
I'm not sure I understand your thinking.

Generally with LED you let the LED draw up to its maximum current (you actually current limit it) at an appropriate forward voltage and then the intensity is modified by turning it on and off rapidly via PWM - at least that's how I do it.

The only thing you need is a PWM and some sort of voltage / current regulator. I've used these regulators in a lot of places > https://www.banggood.com/DC-DC-8A-300W-Buck-Adjustable-Solar-Charging-LED-Driver-Vehicle-Power-Supply-Module-p-1166654.html?rmmds=search, the price of these things makes building one pointless - and more expensive.

And here is everything that I think you're looking for in one package https://www.banggood.com/4V-40V-8A-DC-DC-Buck-Converter-Step-Down-Voltage-Power-Module-PWM-Modulation-p-1117406.html?rmmds=search


 

Offline TheUnnamedNewbie

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: Creating a constant current for powering LEDs
« Reply #2 on: September 23, 2017, 04:34:22 pm »

Generally with LED you let the LED draw up to its maximum current (you actually current limit it) at an appropriate forward voltage and then the intensity is modified by turning it on and off rapidly via PWM - at least that's how I do it.


This depends really. In many applications, a form of constant-current driving might be desired.

If this is the case, usually using a feedback loop with an OTA or opamp can be better. Your DAC can just provide the reference levels.

If you really just desire 3 levels, it might be easier to just give the entire thing a fixed reference voltage and change the shunt resistor (essentially, making your own DAC) by adding parallel resistance. These circuits are generally quite simple.
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline Beamin

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: Creating a constant current for powering LEDs
« Reply #3 on: September 23, 2017, 06:53:44 pm »
I'm not sure I understand your thinking.

Generally with LED you let the LED draw up to its maximum current (you actually current limit it) at an appropriate forward voltage and then the intensity is modified by turning it on and off rapidly via PWM - at least that's how I do it.

The only thing you need is a PWM and some sort of voltage / current regulator. I've used these regulators in a lot of places > https://www.banggood.com/DC-DC-8A-300W-Buck-Adjustable-Solar-Charging-LED-Driver-Vehicle-Power-Supply-Module-p-1166654.html?rmmds=search, the price of these things makes building one pointless - and more expensive.

And here is everything that I think you're looking for in one package https://www.banggood.com/4V-40V-8A-DC-DC-Buck-Converter-Step-Down-Voltage-Power-Module-PWM-Modulation-p-1117406.html?rmmds=search

I clicked those links and now I am out 47.83 for like 19 things. Damn you. I hate buying stuff from china. BUT an Arduino mini for 4.87? I could go down to micro center and pay 35.00 for the same Chinese piece of shit. I had to stop. I honestly don't even remember what I bought but it was cheap so I got 2 of each. Now I'm going to have the great wall of china post on my door step next week. BangGood: "Shopping with fun!" I shopped with fun alright. What ever that means. Maybe I'll just go to that site one more time. Just to look... :scared:
« Last Edit: September 23, 2017, 06:55:44 pm by Beamin »
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline BenKenobi

  • Regular Contributor
  • *
  • Posts: 86
  • Country: gb
Re: Creating a constant current for powering LEDs
« Reply #4 on: September 23, 2017, 07:14:57 pm »
Quote
now I am out 47.83 for like 19 things. Damn you.

I do it all the time - I've got two drawers full of toys, I couldn't build some of the things for the price, OK some of it is junk but a lot of it isn't, but at the prices who cares.

When you order from there make sure to split your orders into sub £25 incl post then you avoid all the duty  :-DD
 

Offline Beamin

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: Creating a constant current for powering LEDs
« Reply #5 on: September 23, 2017, 08:05:17 pm »
Quote
now I am out 47.83 for like 19 things. Damn you.

I do it all the time - I've got two drawers full of toys, I couldn't build some of the things for the price, OK some of it is junk but a lot of it isn't, but at the prices who cares.

When you order from there make sure to split your orders into sub £25 incl post then you avoid all the duty  :-DD
Duty? Like tax? America just lets the Chinese rob us blind. I noticed the prices changed around but it seems like it went from some currency like UKlbs into USD. There was just the price and a small shipping charge. I didn't notice anything as my order I usually watch it like a hawk; for instance Amazon rounds up to the nearest cent at $0.0038 instead of 0.005 like per law in many US states. Amazon cheats on all kinds of stuff like including tax on handling by calling it shipping AND handling and charges tax on service plans and will only take the tax off if you call and bitch. They also sent me a tax ID for my state that I can't find any record of and it took them two days to tell me the number. Bullshit they pay that to the government. They also have some weird round up scheme for the tax that I figured out but couldn't call to have $0.008 cents taken off my bill.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline BenKenobi

  • Regular Contributor
  • *
  • Posts: 86
  • Country: gb
Re: Creating a constant current for powering LEDs
« Reply #6 on: September 23, 2017, 08:19:12 pm »
You're in the US ? they charge US dollars but in the UK Her Majesty's revenue people will ignore anything less than £25, sometimes they will ignore if it is more but generally not then the one told to collect the money will charge a fee too.

It still works out cheaper than buying here but why put money in their pockets if you don't need to.
 

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: Creating a constant current for powering LEDs
« Reply #7 on: September 24, 2017, 08:14:34 am »
Ditch the FET and put an NPN in series with D3 ground side. Drive this with a selected base resistor to give the required LED current.  All that's really needed for a one-off circuit.

Reason for not using a FET is that the conductance is too nonlinear. It also has a large and variable turn-on threshold. The BJT starts to conduct at about 0.6v on the base, and this is fairly repeatable between samples.  Using FETs for current control requires a current sensing resistor and feedback control. Which would probably be the approach adopted in a commercial design because it better allows for component tolerances. For a one-off though, just select the required base resistor for each brightness level. 10k would be a ballpark starting point.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf