Quick question about a Constant Current Source

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
Thank you Scott. That's a great explanation. Regarding 0 degree components, yes I was talking about components whose operating temperatures are 0 to 70. I need -40 to +85. More so because I intend to operate below freezing than above +70.
 

crutschow

Joined Mar 14, 2008
34,452
.......................
Also, if the MOSFET you're using can handle the power dissipation (Vds * Id) then you do NOT need series resistors with the LEDs, for further cost savings. They can help lower the power dissipation in the MOSFET if needed, but since you're regulating the current through the LED string they serve no other purpose. That is unlike the voltage-mode circuits mentioned by Bill and Carl which rely on the resistor drop and the regulated voltages along with the LED voltage drops to define the current... you can see how direct current regulation should be a little better.
The transistor circuit I was referring to is not a voltage mode circuit. Its a constant current circuit where the current is determined by the voltage across the source resistor. When it equals the base-emitter voltage of the BJT it reduces the bias voltage to the MOSFET, thus regulating the current at that value. To a first order the current is unaffected by any LED or other resistor drops (other than the drop across the source resistor). Don't know why you think otherwise(?).
 
The transistor circuit I was referring to is not a voltage mode circuit. Its a constant current circuit where the current is determined by the voltage across the source resistor. When it equals the base-emitter voltage of the BJT it reduces the bias voltage to the MOSFET, thus regulating the current at that value. To a first order the current is unaffected by any LED or other resistor drops (other than the drop across the source resistor). Don't know why you think otherwise(?).
Hi, Carl-
Yes, you're correct. When typing my reply I had thought one of Bill's circuits was in one of your posts... You're summarizing the original circuit. Sorry for any confusion. (I'd edit my post so others wont' be confused but too late...)
Scott
 
A couple other thoughts...
In one of the first posts, Bill shows how to use an LM317 or similar as a current source. This can work well, too, and will have less drift or variation than the simpler current source circuit we're discussing (it has an integrated, likely trimmed bandgap reference).

For the circuit in ke5nnt's post #10, there is a possible simplification if
(1) you don't need much current in the reference branch (R5, Q2),
(2) the output device Q1 has not-too-high of a threshold (Vtn ~ 1 to 1.5V?) and doesn't require too high of a gate-source voltage (Vgs) to reach the operating output current, and
(3) you only need about 1mA in Q2, then
- You can eliminate the ground-side switch (Q3, R2, R3) and simply drive the top of R5 from a port of the uC. (Even lower current might do...)
- The top of the diode string is still tied directly to the +13.8V supply.
- The emitter of Q2 and the bottom of R4 just go to ground.

The idea is 5.1V should be enough to switch (and regulate) the NMOS FET Q1 (we don't need a full 13.8V of range at the gate), and take advantage of the devices in the uC port. The regulation/reference side should have a couple volts of headroom to work with across R5 if the assumptions are met.

Keep the port in full CMOS (or "push-pull", not open drain) mode.
- The port's PMOS FET will be supply-side switch for R5, Q2.
- The port's NMOS FET will be a shut off switch, pulling R5, the collector of Q2, and most importantly the gate of Q1 off.
- The power dissipation in the port and uC will be relatively low, as the PMOS FET is on. The voltage drop depends on the uC and the current you decide to pull in the reference side. (Approx. (VDD-Vds_port-Vtn(Q1)-Vbe(Q2)) / R5 ).

There is a slight concern with the circuit in post #10, in that when off, the gate of Q1 is pulled to supply. When the circuit first turns on there will be a spike of current through Q1 and the LEDs until the feedback loop through Q2 catches up. The top side switched approach ensures that Q1 starts out being off.

The cost is improved quite a bit if this will work for you since you can eliminate Q3, which had to handle as much current as Q1 (though not as much power). Now you're down to just the diode string, two transistors and two resistors.

By the way, using a BJT for Q2 is probably the best approach, since the BJT Vbe is at least more repeatable than a MOS Vt, and the BJT will have more gain and stabilize the circuit operating point better than a MOSFET.

Cheers.
 

Wendy

Joined Mar 24, 2008
23,421
Other options include an LDO (Low Drop Out) regulator using the LM317 approach. Tanner's has a respectable stock of them, though part numbers do not come to mind. It will have all the advantages of a LM317 plus. Jim (owner of Tanner's) knows his components well, just ask him.

I think it is time I verify the LM317 voltage drop in current mode, just to be sure.

You already have a good idea what it will look like, but I'll draw a transistorized version and post it. It does vary a little with temperature, but not much. It is also simple, 6 components, and has a voltage drop out of less than a volt. Because of the low drop out it is one of my favorites.




As with the LM317, R5 is for fine tweaking of the current.
 

Attachments

Last edited:

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
Wow, responses are overwhelming. Bill, I would be interested to see your idea. Transistorized circuit using an LM317 with 1V dropout is far more manageable than the 3V dropout discussed earlier.

Scott, your drawing is interesting. Using your idea, I imagine that the value of R5 would need to come down a bit from 100K (where it's set currently). The LED string max current is 100mA (they are marketed as 100mA LEDs). 85mA was chosen as a safety cushion. Notice in the schematic I posted in 10 that there will be 2 strings operating in tandem, one connected to GP1 and another to GP2 of the micro, both of which can be on at the same time.

There can be any combination of:
A. One string comprised of 3 LEDs with a forward voltage of 2.0V for a total of 6V, leaving roughly 8V to be dropped elsewhere. The second string comprised of the same, leaving 2 8V drops that need dealt with.
B. 2 identical strings of 3 LEDs with a forward voltage of 3.2V which would leave 2 4.4V drops that need dealt with.
C. 1 string of 2.0V LEDs and the other 3.2V LEDs.

The Q1 MOS had a voltage drop of 500mV, string current being set by \(\frac{0.5}{Rsc}\). For 85mA, \(R_{sc} = \frac{0.5V}{0.085A} = 5.88\Omega\)

Power dissipation in Rsc \(P_{R_{SC}} = \frac{V^2}{R_{SC}} = \frac{0.5V}{5.88\Omega} = 42.5mW\) A very manageable power for that resistor.

Q1 Vds will be roughly 4.4V to 8V depending on LEDs chosen for that string. What kind of gate voltage and current that will result in, I'm not sure at the moment. I figure power dissipation within' Q1 is 375mW for a 3.2V diode string and 680mW for a 2.0V diode string. That's not accounting for any resistor(s) in series with the diodes.

If your drawing would work, will Q1 need to be changed to a logic level device to respond to pulses from the MCU?
 
Notice in the schematic I posted in 10 that there will be 2 strings operating in tandem, one connected to GP1 and another to GP2 of the micro, both of which can be on at the same time.
Yes, and you could add more strings until you run out of I/O ports or power dissipation margin for the uC.

If your drawing would work, will Q1 need to be changed to a logic level device to respond to pulses from the MCU?
Actually, not quite: Q1's gate voltage is controlled by the feedback loop and drop across R5 from the +5.1V supply. You can think of the port's output FETs MP and MN as simply switches to the 5.1V supply or ground, allowing the circuit to operate or to shut it down, respectively.

So you need to verify that the Q1 gate voltage does not need to go too high for your 85mA target... As long as there is some headroom between Q1 Vg to your +5.1V over all conditions then it will be fine... (and if not, it won't regulated well). It may require selecting a different device, but not so much to match some logic level as for overall current capability at a given Vgs. (And remember that Q1 Vs is the base voltage of the BJT Q2, which takes away from the headroom).

Do you have some devices in mind for Q1 and Q2?

Cheers.
 
Q1

Q2

These are initial selections, nothing is set in stone yet.
Thanks. For Q1, the FDB33N25 / FDI33N25 device can handle 30V at the gate, 250V Vds and over 20A... and it requires up to 5V Vgs for only 250uA... so it will work with your first schematic in post #10, but not with the suggestion for a simpler approach with a port for the top side switch.

For that it would be good to find a MOSFET that only needs 3V or so for 100mA and can handle ~15V Vgs and ~20V Vds. Some of the vendor websites have selection guides with filters to sort for these parameters.
 

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
What I'd like to do at this point is make sure that I'm understanding the circuit correctly, since I'm not fully versed on MOSFETs and transistors.

Referencing Scott's Circuit:

Source voltage supplies the required voltage to the load. A MOSFET is a voltage driven device, meaning that current flows from ground to the load when Q1's \(V_{GS}\) requirement is met. In this case, you're telling me that \(V_{GS}\) should be near 3V.

Current is regulated by Rsc. When current gets too high, current flows into the base of Q2 (a transistor and thus a current-driven device) which allows current to flow from the IC gate through R5 through Q2 to ground, which in turn lowers the voltage at the Gate of Q1, which lowers the current flowing from Drain to Source of Q1, thus keeping current relatively constant at whatever value it's set at by Rsc?

Assuming that's correct, here are my questions:
1. If source voltage is ~13.8V and the "load" drops 6V, what happens to the other 7.2V? Is it dissipated by Q1, or Rsc?
2. When current get's too high and Q2 starts to conduct, how do I determine how much current will flow out of the MCU I/O gate to lower the voltage at \(V_{GS}\)? An I/O pin on a MCU device typically has a limit of ~20-25mA.
3. How do I determine the power dissipation requirements of Q1 and Q2, and also Rsc?

Sorry if these questions seem relatively simple, but I need help understanding them.

I really appreciate all your help guys. I'm learning a lot and I appreciate your patience with me while I learn.
 
Hi, ke5nnt- These are good questions, and I'm working on some similar LED lighting projects on the side, so you've caught my interest...

[The +13.8V supply] voltage supplies the required voltage to the [LED string] load. A MOSFET is a voltage driven device, meaning that current flows from ground to the load when Q1's \(V_{GS}\) requirement is met. In this case, you're telling me that \(V_{GS}\) should be near 3V.
Yes, that's a good target to have some headroom for variations.

Current is regulated by Rsc. When current gets too high, current flows into the base of Q2 (a transistor and thus a current-driven device) which allows current to flow from the IC gate through R5 through Q2 to ground, which in turn lowers the voltage at the Gate of Q1, which lowers the current flowing from Drain to Source of Q1, thus keeping current relatively constant at whatever value it's set at by Rsc?
You can look at the circuit as having a continuous negative feedback loop formed by Q1, Rsc (R4?), Q2 and R5. Q2 forms a common-emitter amplifier with R5 partly determining its gain. This is an inverting configuration... As the base voltage of Q2 goes up, the Q2 collector current increases and the collector voltage is pulled down. (I tend to think of this as a voltage-gain from the base to collector, though there is base current, as well.) The system should stabilize at an an operating point where Q2 Vbe is "just right" to pull the MOS Q1 gate down to the point where the load current gives the right Vbe... and if it pulled the gate too low, the current would drop and Vbe would be pulled down, raising the gate votlage... (it's a loop, repeat ad infinitum...)

Assuming that's correct, here are my questions:
1. If source voltage is ~13.8V and the "load" drops 6V, what happens to the other 7.2V? Is it dissipated by Q1, or Rsc?
For both Q1 and Rsc (R4?), their power dissipation is given by V * I (voltage across the device * current through it). Since the current is the same and we know the votlage across Rsc is about 0.7V, the we know Q1 Vds will be about 6.5V. So the Q1 MOSFET absorbs most of the power. At 100mA and 6.5V it's 0.65W... You'll want to choose a device with headroom to this, check whether you need a heat sink and/or you could add some power resistors to take up some of the voltage and power (heat).

2. When current get's too high and Q2 starts to conduct, how do I determine how much current will flow out of the MCU I/O gate to lower the voltage at \(V_{GS}\)? An I/O pin on a MCU device typically has a limit of ~20-25mA.
As discussed above, Q2 always conducts. The feedback is always there, helping to stabilize the operating point. Okay, the operating point of Q2 can be roughly determined by understanding what controls the voltages across it. Fortunately for this circuit, we have two transistors with some characteristics that we know reasonably well.

First let's make some assumptions:
1) Q2's Vbe voltage will be around 0.7V... it may be 0.6 or 0.8V, but close to 0.7.
2) Q1, since we're selecting this device to have about 2 to 3V Vgs when conducting 100mA, we can assume Vgs is 2 to 3V.

Okay, given those assumptions we now the collector voltage of Q2 is Vbe + Vgs = 2.7 to 3.7V. For a 5.1V supply, the resistor R5 will have a drop of (5.1-3.7) to (5.1-2.7)V or 1.4 to 2.4V. So now we choose R5....
1) We want some decent gain in the Q2 amplifier, and this gain is given approximately by R5/re... and re is VT/Ie or 26mV/Ie. Ie is the emitter current, which is approximately equal to the collector current if Q2 has a decent beta (100?).
2) We want to have a current in Q2 low enough that our uC port can support it. Let's go for 1mA.

Okay, now we check our gain and then the assumptions.

First, what is R5? For 1mA at the mid-point of 1.4 to 2.4V, or 1.9V, we need R5=1.9kohm... okay, call it 1.8k or 2.0k if you want a more standard value. Let's try 1.8k to get more headroom. Then re is approx. 26mV/1mA = 26 and voltage gain Av is 1800/26 = 69 (or about 37dB, not bad). (This might be a bit too approximate...)

Now check the assumptions:
1) Is Vbe about 0.7V? Well, this depends on your choice of a device for Q2. 1mA is not a very high current for most general purpose BJT's so this may be fine. You can check device curves in the data sheet.
2) Is Vgs about 2 to 3V? Again, we assumed that we'd be choosing a good MOSFET with this range of Vgs for 100mA load.

Lastly we need to set Rsc (R4). For 0.7V and 100mA, we have R4=0.7V/0.1A=7ohm. That's low... but you can purchase precision (metal film?) resistors in this range. You can pick one reasonably close to the desired values.

Note: one of the reasons it's good to have a BJT for Q2 is that Vbe is fairly stable over a wide range of current... Vbe changes 18mV for every doubling in collector current. This is another way to see how much gain the feedback loop has: A load current change of 18mV/7ohm = 2.5mA would double the collector current in Q2, and change the Q1 gate voltage by 1.8V... If you know the change in Q1 current for that Vgs change you'll know the loop gain, but it's quite high.

3. How do I determine the power dissipation requirements of Q1 and Q2, and also Rsc?
See above for Q1 and Rsc. For Q2 we have our 1mA * about 3.7V (at the collector) or 3.7mW. Not much.

Sorry if these questions seem relatively simple, but I need help understanding them.

I really appreciate all your help guys. I'm learning a lot and I appreciate your patience with me while I learn.
No problem. Next step will be to build and/or simulate the circuit... I may put together a quick sim to check things and post later.

Keep us posted on any progress with your project...

Cheers.
 

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
Ok, wow man. That's some amazing information.

I'll start looking at BJTs for the transistor. In the meantime, have a look at This Power MOSFET. It seems to have several of our requirements, a Vgs of about 3V, 16V DC (20V pulsed) gate-source breakdown, Drain-Source breakdown of 55V, Rds(on) of about 18mOhms, etc etc. Plus, it is designed for my intended environment, which is a bigger plus.

Your assumption that R4 is Rsc is correct, sorry... must have forgotten to mention that before.

mixed_signal said:
We want some decent gain in the Q2 amplifier, and this gain is given approximately by R5/re... and re is VT/Ie or 26mV/Ie. Ie is the emitter current, which is approximately equal to the collector current if Q2 has a decent beta (100?).
Some of your terminology is greek to me at this point. Honestly, I've never dealt with gain before so I don't have any base knowledge to be able to follow you on that. That being said, I don't know what "re" is referring to. Also, I don't know what you mean by beta (100). Sorry Scott, I know you've explained a ton and I don't mean to keep bombarding you with more questions.

mixed_signal said:
Then re is approx. 26mV/1mA = 26 and voltage gain Av is 1800/26 = 69 (or about 37dB, not bad).
Same as above (the "greek" thing) :rolleyes:

mixed_signal said:
Lastly we need to set Rsc (R4). For 0.7V and 100mA, we have R4=0.7V/0.1A=7ohm. That's low... but you can purchase precision (metal film?) resistors in this range. You can pick one reasonably close to the desired values.
Should we be setting Rsc for 100mA when target is ~85mA? Also, metal film resistors would be my choice for their superior stability and the fact that I can get precision 1% resistors.

Everything else is pretty clear. Thanks again man, I really owe you something nice!

EDIT: ADD PART

BJT? This looks okay, but I might be missing something: Click Me
 
Last edited:
The attached schematic and waveforms are from an LTSpice simulation of the "simpler approach" circuit. I used some reasonable devices from the provided libraries and a model of uC port I had developed earlier. The results look pretty good... Vbe is 0.66V with a 2N2222. Switching time is quite fast, though I don't know how well gate capacitance of the FET (IRF8910) is modeled.

I made two other checks:
- LED current varies only 25uA as the main supply goes from 10 to 15V.
- LED current varies 2mA as the 5.1V supply goes from 4.5 to 5.5V.
- LED current varies quite a bit over temperature, from about 110mA at -40C to 80mA at 85C and down to 75mA at 100C.

You may be able to find a resistor with a negative temperature coefficient that will compensate for this somewhat.. .though it needs to change quite a bit. Here is where the LM317 current regulator approach will have more consistent performance. But you have to trade off cost, size, etc. and decide what best meets your overall requirements.

Cheers.
 

Attachments

In the meantime, have a look at This Power MOSFET. It seems to have several of our requirements, a Vgs of about 3V, 16V DC (20V pulsed) gate-source breakdown, Drain-Source breakdown of 55V, Rds(on) of about 18mOhms, etc etc. Plus, it is designed for my intended environment, which is a bigger plus.
This should work, but it can handle quite a bit more power than you need.

Some of your terminology is greek to me at this point...
We all start somewhere... It's good you want to figure these things out, though. You might want to purchase an introductory electronics text book such as Millman & Grabel or Sedra & Smith (used are about $20). I'm sure others on the board will have recommendations if interested. Most of this analysis is what you'd get in a 2nd or 3rd year electronics course in a BSEE program. (You can even find a lot of material online for these courses, usually in PowerPoint slides.)

Should we be setting Rsc for 100mA when target is ~85mA? Also, metal film resistors would be my choice for their superior stability and the fact that I can get precision 1% resistors.
Yes, and yes metal film resistors would be good.
 

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
mixed_signal said:
- LED current varies quite a bit over temperature, from about 110mA at -40C to 80mA at 85C and down to 75mA at 100C.
What component(s) has the greatest effect on this? In other words, what is causing the current to vary this much over the temperature range. Seeings as how 100mA is the maximum forward current of the diodes, it would be preferable to see that the current does not exceed this.

On the other hand, if by being in such a cold temperature as -40 Celsius, the diodes are better able to handle slightly above 100mA more than if they were in a hot environment, this might be ok. I believe the max current limit is in place so that the emitter of the diode doesn't overheat and burn up. Extreme cold might reduce this effect and I may not have to worry about 8 or 10 extra milliamps.

EDIT: Additional info

mixed_signal said:
This should work, but it can handle quite a bit more power than you need.
This MOSFET might be more suited to my needs. At half the cost, it still maintains the operating parameters I desire.
 
Last edited:
What component(s) has the greatest effect on this? In other words, what is causing the current to vary this much over the temperature range. Seeings as how 100mA is the maximum forward current of the diodes, it would be preferable to see that the current does not exceed this.
Yes, with that circuit you'd want to consider dropping current at +85C to about 70mA to hit 100mA at -40C... or more to add margin.

The Vbe (and diode foward voltages) have a negative temperature coefficient of -2.2mV/degC. Over the 140C range simulated this is 308mV, increasing from room temp. (25C) by 143mV at -40C and dropping by 165mV at 100C. That accounts for most of it, since +/-150mV/7 ohms is +/-21mA. The simulated change is a little more... The "little re" is the effective emitter resistance in the device and it drops the effective Vbe a little.

The temperature change can be reduced with some additional resistance in the emitter... at the expense of dropping the loop gain... Av=Rc/(Re + re). The variation with supply would increase but it's tiny with the present circuit. You should get a copy of LTSpice and see what you can do with some tweaks.

By the way, the LM317 current regulator approach in Bill's post #13 is still worth considering if you need really good regulation over temperature. The app notes for these parts (or datasheet) should show this configuration, as well. And the switch MOSFET is basically the same in either circuit.

The newer FET looks good, I think. It has even lower Vgs_on (Vt), as well.
 
Last edited:

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
Ok, let's talk about the LM317 for a minute then. Looking at the datasheet for this series of devices, looks like the forward voltage drop across the regulator is only 1.3 to 1.75V depending on temperature, which is good. Since all of this is pretty new to me, a lot of it is speculation, so please correct me if I'm wrong. Here's an updated circuit using the 317.



Main voltage line enters the 317, current through the LED string is set by R4(Rsc) at approximately \(\frac{V_{ref}}{R_{SC}}\). Current is stable over voltage fluctuations? Also, how is power dissipation in the 317 calculated? Would it be the forward voltage drop (approx 1.75V) times set current? In this case \(P_{diss} = 1.75V \cdot 0.085A = ~149mW\)?

Another question would be, assuming a 1.75V drop across the 317 plus the 6 to 9.6V drop across the LED string, subtracted from source voltage of approx 13.8V, \(V_{IN} - (1.75V + V_f_{string})\) can range from 2.45V to 6.05V, what happens to the extra voltage here? It has to be dissipated somewhere. Would it be in the switching MOSFET?

Thanks again guys.
 

John P

Joined Oct 14, 2008
2,026
You have a misconception about what a current regulator does. The whole point is that it will drop ALL the voltage in the circuit that isn't taken up by the other components.

So you have next to no drop across the MOSFET and a minimum of 6V across the LEDs. Then there is going to be 1.25V across R4 (that's inherent in the design of an LM317) and then everything else is dropped across the regulator. It looks like a worst-case of just under 6V. Power dissipation will be that voltage multiplied by the current, but with 85mA flowing, it doesn't seem scary. And R4 needs to be 1.25/.085, call it 15 Ohms. But you do need to check the thermal characteristics of an LM317--and you also need to think about what its operating temperature will really be. Does it matter if the current changes as the regulator warms up?
 

Thread Starter

ke5nnt

Joined Mar 1, 2009
384
You have a misconception about what a current regulator does. The whole point is that it will drop ALL the voltage in the circuit that isn't taken up by the other components.

So you have next to no drop across the MOSFET and a minimum of 6V across the LEDs. Then there is going to be 1.25V across R4 (that's inherent in the design of an LM317) and then everything else is dropped across the regulator. It looks like a worst-case of just under 6V. Power dissipation will be that voltage multiplied by the current, but with 85mA flowing, it doesn't seem scary. And R4 needs to be 1.25/.085, call it 15 Ohms. But you do need to check the thermal characteristics of an LM317--and you also need to think about what its operating temperature will really be. Does it matter if the current changes as the regulator warms up?
So the regulator power is ~6.0V minus Vref 1.25V, or 4.75 times 85mA = ~404mW. That's not too bad.
Current changes over temperature are not a problem as long as the change isn't enough to drive the current through the LEDs over 100mA. I selected 85mA to allow some head-room, but I still need to hook up one of these LEDs and vary the current through it to see if there's a horrendous change in apparent brightness dropping the 15mA. I doubt there will be, but right now, that's not important. The thing to take away, is that Imax for the LEDs are 100mA.
 
Top