Author Topic: Constant current confusion  (Read 11916 times)

0 Members and 1 Guest are viewing this topic.

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #25 on: July 16, 2016, 04:01:47 am »
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct. I'm using the http://www.diodes.com/_files/datasheets/AP3211.pdf as a buck converter at 2.4v. It has a Feedback voltage of 0.81v, so I set R1 and R2 to 10k ohms and 5.1k ohms respectively. This should give me a power output of 2.4v, just above the forward voltage of the LED's at 2.2v. The MCU controls the LED's via BJT's that sink the current to ground. Does anyone see anything wrong with my design? Is a 0.5 amp diode ok to use if the circuit will be drawing between 400-500ma? Did I do the math correctly on the resistors?
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #26 on: July 16, 2016, 06:02:46 am »
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct. I'm using the http://www.diodes.com/_files/datasheets/AP3211.pdf as a buck converter at 2.4v. It has a Feedback voltage of 0.81v, so I set R1 and R2 to 10k ohms and 5.1k ohms respectively. This should give me a power output of 2.4v, just above the forward voltage of the LED's at 2.2v. The MCU controls the LED's via BJT's that sink the current to ground. Does anyone see anything wrong with my design? Is a 0.5 amp diode ok to use if the circuit will be drawing between 400-500ma? Did I do the math correctly on the resistors?

You seem to be progressing it nicely.
The voltage drop across an LED (Vf) is not rigidly fixed. It varies from device to device, with temperature and LED colour, so trying to give it exactly the right voltage is not the best of ways of doing it. You need to use something which controls and limits the current, or use resistors and a partially higher drive voltage, to give the resistors some headroom.

That's the advantage of switch mode LED drivers. As well as the buck converter, they regulate the current for you as well, for all 4 channels. But they are a bit harder to use, so I understand if you want to avoid them.

If you raise the voltage to about 3.5V (but a bit too low and tight), 4V or more. You can then calculate resistors (in series with each LED) which will give the desired current (100mA). The datasheet you supplied gives the typical forward voltages. You will probably need different resistors, depending on LED colour, as the Vf changes, ideally you want different resistor values.

Here is an online LED resistor calculator, or better still do it yourself.
http://ledcalc.com/

Opinions will probably vary as to how much more voltage you need, if using resistors.

Also the transistors will have a bit of voltage drop across them, depending on how saturated the transistor is, with whatever the base current is and what transistor they are. (See its datasheet).
« Last Edit: July 16, 2016, 06:09:18 am by MK14 »
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #27 on: July 16, 2016, 06:21:57 am »
Or as another post said earlier, you could make constant current generators. But then it is getting so much more complicated, that the all in one, switch mode LED driver chip(s), becomes increasingly attractive.
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: Constant current confusion
« Reply #28 on: July 16, 2016, 07:27:23 am »
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct.
Dude, you are heading in exactly opposite direction we are pointing you at  :palm:

Hopeless, concerning number of hints given.
 
:--
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Constant current confusion
« Reply #29 on: July 16, 2016, 09:00:49 am »
Quote
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct. I'm using the http://www.diodes.com/_files/datasheets/AP3211.pdf as a buck converter at 2.4v. It has a Feedback voltage of 0.81v, so I set R1 and R2 to 10k ohms and 5.1k ohms respectively. This should give me a power output of 2.4v, just above the forward voltage of the LED's at 2.2v. The MCU controls the LED's via BJT's that sink the current to ground. Does anyone see anything wrong with my design? 
Firstly, the LEDs are the wrong way round.
Second, not sure you understand the idea behind constant current throught the LEDs, your circuit could potentially burn out the LEDs. The switcher is controlling voltage and there is nothing to control the current through each LED.
Thirdly, if it takes 2.4V to drive the LED then they will not light up, the BJTs will drop 1.4V.

Raise the switcher voltage to 5V.
Put the LEDs the right way round.
Add current limiting resistors to each LED, at 5V supply, 5V - 2.4V - 1.4V = 3.8V, this gives a current limiting resistor of around 38Ohms

[edit] sorry if you saw my first post with 1.4 ohms, do not know what I was thinking. I realised my mistake while brushing my teeth :-[
« Last Edit: July 16, 2016, 09:37:28 am by MosherIV »
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #30 on: July 16, 2016, 09:22:48 am »
Quote
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct. I'm using the http://www.diodes.com/_files/datasheets/AP3211.pdf as a buck converter at 2.4v. It has a Feedback voltage of 0.81v, so I set R1 and R2 to 10k ohms and 5.1k ohms respectively. This should give me a power output of 2.4v, just above the forward voltage of the LED's at 2.2v. The MCU controls the LED's via BJT's that sink the current to ground. Does anyone see anything wrong with my design? 
Firstly, the LEDs are the wrong way round.
Second, not sure you understand the idea behind constant current throught the LEDs, your circuit could potentially burn out the LEDs. The switcher is controlling voltage and there is nothing to control the current through each LED.
Thirdly, if it takes 2.4V to drive the LED then they will not light up, the BJTs will drop 1.4V.

Raise the switcher voltage to 5V.
Put the LEDs the right way round.
Add current limiting resistors to each LED, at 5V supply, 5V - 2.4V - 1.4V = 3.8V, this gives a current limiting resistor of around 1.4Ohms

Well spotted that the LEDs are the wrong way round.
Unfortunately I missed that, so I feel a bit foolish, as I should have noticed it as well.  :-[ :-[ :-[

What makes you think BJTs will drop 1.4 Volts ?
It should be a fair bit less than that, lots less if suitably saturated. E.g. 0.2 V (saturated) or a diode drop (not especially saturated), approx.
Maybe you are thinking of darlington transistors, which do have higher voltage drops, because of the second transistor ?

1.4 Ohms ???????
That seems amazingly low, can you show your calculation ?
Maybe you accidentally put the decimal point in the wrong place or something ?
It's going to more like 25 Ohms, depending on the supply voltage. I.e. about 10 Ohms per volt dropped, for 100mA.

Also  "5V - 2.4V - 1.4V = 3.8V", actually it is = 1.2V, ignoring that I don't agree with the voltages either.
But it is very easy to miss-key a calculator.
« Last Edit: July 16, 2016, 09:50:11 am by MK14 »
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #31 on: July 17, 2016, 02:52:07 am »
I've attached a schematic of a possible LED driver circuit that I want to make sure is correct.
Dude, you are heading in exactly opposite direction we are pointing you at  :palm:

Hopeless, concerning number of hints given.
 
:--
Well then, what would you recommend? The 4 bit constant current LED driver IC?  I appreciate your concern and patience, as well as the additional help you've added to this thread.  :-+

As for the rest of the comments:
Whoops, didn't notice the LED's were switched. I assumed that because the LED's forward voltage requirements were met, they would draw the correct amount of current, but I didn't consider voltage drop across the transistors. I've seen people drive high power LED's from a very specific voltage before without current limiting (from a bench power supply), but maybe I'm missing something. So if I set the DC-DC buck converter to 5v, then I should add ~25 ohm resistors (depending on the voltage drop across the transistor and the current draw of the LED) to limit current, so long as the transistor is saturated.

« Last Edit: July 17, 2016, 03:04:38 am by tyguy2 »
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Constant current confusion
« Reply #32 on: July 17, 2016, 02:55:14 am »
I assumed that because the LED's forward voltage requirements were met, they would draw the correct amount of current

You need to meet their forward voltage requirement very precisely, and it varies per-LED, with current, with temperature.. This is why you use constant current, not constant-voltage.

What voltage will your micro run from?
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #33 on: July 17, 2016, 02:58:23 am »
I assumed that because the LED's forward voltage requirements were met, they would draw the correct amount of current

You need to meet their forward voltage requirement very precisely, and it varies per-LED, with current, with temperature.. This is why you use constant current, not constant-voltage.

What voltage will your micro run from?

It's a 5v micro, so I plan on running that on the same power rail (if I go with a 5 volt config)
« Last Edit: July 17, 2016, 03:01:26 am by tyguy2 »
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Constant current confusion
« Reply #34 on: July 17, 2016, 02:59:08 am »
I assumed that because the LED's forward voltage requirements were met, they would draw the correct amount of current

You need to meet their forward voltage requirement very precisely, and it varies per-LED, with current, with temperature.. This is why you use constant current, not constant-voltage.

What voltage will your micro run from?

It's a 5v micro, so I plan on running that on a separate power rail

Or.. just use a buck converter to get 5V and run the LEDs from it too.
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #35 on: July 17, 2016, 03:00:42 am »
 :-DD Whoops, didn't notice that. I'm a bit tired right now
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Constant current confusion
« Reply #36 on: July 17, 2016, 10:53:31 am »
Quote
As for the rest of the comments:
Whoops, didn't notice the LED's were switched. I assumed that because the LED's forward voltage requirements were met, they would draw the correct amount of current, but I didn't consider voltage drop across the transistors. I've seen people drive high power LED's from a very specific voltage before without current limiting (from a bench power supply), but maybe I'm missing something. So if I set the DC-DC buck converter to 5v, then I should add ~25 ohm resistors (depending on the voltage drop across the transistor and the current draw of the LED) to limit current, so long as the transistor is saturated.

Diodes (including LEDs) must have current flowing anode to cathode or they will not work. They are commonly used to stop current flowing in the wrong direction eg rectifier diodes in linear power supply.

If the voltage drop for the transistor is not taken into account, the calculation for the current limiting resistor will give a value that is too high. At lowish LED currents, it may not light at all. The 100mA that you are looking for, you probably would not notice a difference.
My background is an embedded software eningeer, so I usually use LED as indicators. Not interrested in brightness, so I useally use 2 diode drops for the voltage across a BJT and 20 to 30mA for LED current, the calcualtion works for me.

As for some people driving LEDs from psu without current limit, LEDs can be abused for short periods of time and survive, not sure how long they will last though.

I took another closer look at the data sheet for the LED. You have not said which colour you are using, hence it is not clear what the max current is for the LED.
Why are you driving the LED at 100mA?
This is going to produce a VERY bright LED output. If this is just for an indication for someone to look at, it will be very unconfertable, will leave bright spots in their vision. If they are being used to light up dark areas then ok.

I would not class these as the high power LEDs. 100mA is near the top limit of normal LEDs these days.
« Last Edit: July 17, 2016, 10:56:12 am by MosherIV »
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #37 on: July 17, 2016, 06:29:22 pm »
The colors I'm using are Red, Red-Orange, and Green, which all have the same max currents (125ma) (see page 4 http://www.mouser.com/ds/2/602/DS146-748694.pdf) I'm diffusing these LED's over a larger area (they are going to act as a large wall mounted indicator, hence red, orange, and green, each LED will light a circle about 40 cm in diameter), so it shouldn't be too bad, right? I could also reduce the current being provided to it by changing the resistor of the LED to reduce brightness.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #38 on: July 17, 2016, 07:07:23 pm »
So I fixed the LEDs, and added the resistors to limit current, set the supply voltage to 5v, and put the resistors on the collectorsto 330 ohm to saturate the BJT.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Constant current confusion
« Reply #39 on: July 17, 2016, 08:28:15 pm »
Quote
  I'm diffusing these LED's over a larger area (they are going to act as a large wall mounted indicator, hence red, orange, and green, each LED will light a circle about 40 cm in diameter), so it shouldn't be too bad, right? I could also reduce the current being provided to it by changing the resistor of the LED to reduce brightness.
Near full power spread over 40cm diameter, still might be too bright. Try it and see.
Yes, if it is too bright, you just adjust the resistor which controls the LED brightness.

The circuit looks ok now.

 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #40 on: July 17, 2016, 08:29:19 pm »
Thanks
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #41 on: July 17, 2016, 10:05:17 pm »
I don't know if you've seen this

http://www.diodes.com/_files/product_app_note_pdfs/AN1063.pdf

But it explains how to select (and calculate the required ratings) the right diode for D1.

How are you planing to "cool" the LEDs ?

The app note (have you seen it ?), explains that it needs to be done, as is typical for LED lights, where there is quite a task to do (PCB wise), to keep them cool.
Via a metal layer built into the PCB, or multi-layer PCB boards. If I understood it correctly.
« Last Edit: July 17, 2016, 10:06:50 pm by MK14 »
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #42 on: July 17, 2016, 10:11:24 pm »
Yes, I saw the application note on cooling the LEDs. I'm cooling them with a copper pour around each LED on both layers of the PCB with Vias to connect them (as well as possible heat sinks on the back of the board). Thanks for the info on diodes.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #43 on: July 17, 2016, 10:15:43 pm »
Yes, I saw the application note on cooling the LEDs. I'm cooling them with a copper pour around each LED on both layers of the PCB with Vias to connect them (as well as possible heat sinks on the back of the board). Thanks for the info on diodes.

Good.

http://www.lumileds.com/uploads/403/AB203-pdf

Also you can control the brightness via PWMing the MCU outputs, if you are handy enough with software. Hardware (changing the resistors, as mentioned above by another poster) would work as well.
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #44 on: July 17, 2016, 10:21:46 pm »
R7 to R10, 330 Ohms, is fairly low. You might want to check that the microcontroller has outputs, rated at high enough current (a touch under 15 mA's, assuming still 5V supply for MCU). Many will have enough, but not all. If it is too high for them, then just use higher value resistors. At such a relatively low output current to the LEDs, you should still have plenty of Hfe (gain if you like) in the transistors, to give a suitably low voltage drop across the transistors.
« Last Edit: July 17, 2016, 10:23:43 pm by MK14 »
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #45 on: July 17, 2016, 11:00:12 pm »
The MCU I'm using can provide 45 ma per pin, so it should be fine.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #46 on: July 17, 2016, 11:37:50 pm »
The MCU I'm using can provide 45 ma per pin, so it should be fine.

Wow 45 mA's.

Can I be curious and ask what it is then ?

I've only seen ones that go up to about 25 mA's, such as some PICs, if I remember correctly.

EDIT:
It's ok, you are talking about Arduino I think.
Google was my friend.
I think the later MCU's (which I was thinking of) have a smaller feature size, so they are not so good at giving maximum output current capabilities (but there may be exceptions). But older chips which I suspect you are using, still might.
« Last Edit: July 17, 2016, 11:48:05 pm by MK14 »
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Constant current confusion
« Reply #47 on: July 17, 2016, 11:47:56 pm »
The MCU I'm using can provide 45 ma per pin, so it should be fine.

Wow 45 mA's.

Can I be curious and ask what it is then ?

I've only seen ones that go up to about 25 mA's, such as some PICs, if I remember correctly.

One of the AVRs, I imagine. They do have rather robust pin drivers.
 
The following users thanked this post: MK14

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: Constant current confusion
« Reply #48 on: July 17, 2016, 11:49:50 pm »
The MCU I'm using can provide 45 ma per pin, so it should be fine.

Wow 45 mA's.

Can I be curious and ask what it is then ?

I've only seen ones that go up to about 25 mA's, such as some PICs, if I remember correctly.

One of the AVRs, I imagine. They do have rather robust pin drivers.

Thanks!

45mA's is rather amazing, because you can do a heck of a lot with that. It's almost enough to drive those LEDs on its own.
It must save needing external small signal transistors on the outputs, in many cases.
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Constant current confusion
« Reply #49 on: July 18, 2016, 12:59:44 am »
It's an Atmega1280, I believe.
« Last Edit: July 18, 2016, 01:54:44 am by tyguy2 »
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf