Constant Current Sources
In the following I'll discuss advantages and disadvantages of several types of constant current sources, all built with bipolar transistors.
Why, you may ask, there are already numerous books and websites covering this subject. Well, I needed one for a special project and I made a few simulations with a special focus on temperature dependency, a point which most of the sites I found silently avoid or cover it only in a cursory manner.
In the following circuits, Q1 is always the regulating transistor and VS is the supply voltage, which in many cases will be a regulated DC supply but may also be the unregulated voltage directly from the bulk capacitor.
I do not distinguish current sinks from current sources. Consider a sink simply as a source of negative current and you know why. They are complementary parts. You will use a NPN transistor for a sink with a load to the positive rail and a PNP for a source with a load against a more negative one (GND, normally).
There are some guys (telecom) that ground the positive rail and thus have a negative supply. The terms sink
and source
had just to be swapped then...
You can find my simulations on the downloads page.
General Circuit
Most constant current sources follow a very simple principle: keep a constant voltage (Vref) at the base of a BJT and you'll get a constant voltage at the emitter. Connect a constant resistor (Rshunt) from emitter to GND (or to VS for a PNP) and you'll get a constant emitter current. This is also nearly the collector current so no matter what you connect to the collector, it will carry the same current.
The reference voltage obviously has to be more than the base-emitter voltage of the transistor plus some amount to drop across the shunt resistor.
Well, in theory this works but in practice this circuit, although using an ideal reference voltage, has a relatively large temperature coefficient due to the TC of the base-emitter voltage of about -2 mV/°C. The higher Vref, the lower its influence but the higher is also the voltage drop across the circuit.
Even with an ideally stable reference voltage, the current through RLoad would not be constant if the temperature of Q1 varies!
Since the voltage across base and emmiter lowers with rising temperature of Q1, the voltage over Rshunt rises accordingly, thus increasing the current flowing.
Dropout Voltage
When we talk about the dropout voltage
or the voltage drop
of the circuit, I mean the part of VS that the circuit needs for itself
and that is not available at the load:
Let's consider the circuit as a series connection of RLoad, Q1 and RShunt. The sum of these three voltages is VS. For the case of a low impedance load, most of VS drops across the transistor. The regulation just makes the transistor enough conductive such that the required current can flow. As RLoad increases, the voltage across the load increases and that across Q1 decreases accordingly. Ideally, the value above RShunt remains constant because we want to build a constant current source. At some point we reach the saturation voltage of the transistor. It can no longer become more conductive and from this point on the load no longer has enough voltage available to draw the wanted current.
The voltage drop of the circuit is the saturation voltage of the transistor plus the voltage across RShunt at the nominal current.
A Note about Temperature Compensation
I found several circuits on the web that point at some part and say it is for temperature compensation. Be careful when following such promises. Temperature compensation always requires tight thermal coupling between the compensated and the compensating part. Without that, the circuit is only compensated for changes of the ambient temperature. Self heating of the transistor must be transferred as fast and as perfectly as possible to the compensating device. As we will see, this is not always a simple task.
1) A Simple Approach
The simplest (and cheapest) way to produce Vref is a voltage divider. Obviously, this only works if VS is constant. Also, the current through the voltage divider has to be much higher than the base current to reduce temperature effects on the current gain and due to production spread.
This circuit is not temperature compensated at all. You'll get the -2 mV/°C from VBE what will result in a positive TC of the current, depending on the voltage across R2.
2) Two Transistors
In the next circuit, transistor Q2 limits the base current of Q1 as soon as the shunt voltage reaches its threshold. This results in a very high TC, -2 mV/°C add directly to the shunt voltage which is only ~600 mV here what makes about 0.3%/°C. The advantage is the low voltage drop (remarkably below 1V) of the whole circuit, only slightly superset by the next circuit.
In contrast to other circuits, Q2 should here be mounted thermally as isolated as possible from Q1 since the current is mainly determined by Q2. Then practically only the ambient temperature plays a role, the variance of which is normally much smaller than the self-heating of Q1. Nevertheless, Q2 must of course be in the vicinity of Q1 for circuit-technical reasons and will thus always also experience the generated heat from Q1 up to a certain degree.
Note: this is not about temperature compensation but about minimizing the influence of self-heating! Changes of the ambient temperature still have full effect.
3) Diode Reference
Since the forward voltage of an ordinary diode is quite constant, you may also use one as a reference. As we have seen, the reference must be larger than VBE so we need two of them. The advantage of this circuit is its low dropout voltage since the voltage across the shunt is only ~600 mV. (D1 roughly compensates for the TC of Q1, but the TC of D2 has a full impact). This has to be paid with a high TC of about 0.3%/°C and the by far worst line regulation in this comparison.
So the best temperature compensation could be achieved if D1 is thermally coupled to Q1 while D2 is kept at ambient temperature as close as possible, which normally varies only slightly. My simulations do not reflect this, since the degree of coupling or isolation depends to a large degree on your layout and a possible enclosure. This would have to be tested out for any special case.
4) LED Reference
This is the first circuit that claims to be temperature compensated. The idea is that the forward voltage of a red LED is about 1.8 V and thus can be used as a single reference element. Also, the TC of the LED compensates for the TC of the transistor, voila: ideal circuit! But beware: the temperature of the LED must be the same than that of the transistor for this to work! Good thermal coupling between a LED and a transistor is not easy, especially for THT parts.
If you have only low current, where self heating of the transistor can be neglegted, this circuit may perform quite well.
Well, I am not a friend of such tricks. The forward voltage is not a guaranteed parameter of a LED. It may vary from part to part, for different manufacturers or if the chemistry changes (e.g. from GaAsP to InGaAlP). Even if you get a low TC, the absolute accuracy may be poor. If your cirquit is on the long run, your LED will become obsolete some day and you may get into trouble...
5) Zener Reference
The next approach frequently seen is using a Zener diode. Here you have two temperature coefficients, the transistor and the diode. Due to the nature of a Zener diode, its TC depends on the Zener voltage. Below a certain voltage the zener effect with its negative TC dominates while higher voltages are mainly affected by the avalance effect having a positive TC. For diodes <5 V the TC is negative, for such >5 V it is positive. Around 5 V it is close to 0. By playing with the Zener voltage you can get a fairly low TC for the whole circuit.
Since the TC of the VBE is negative with about -2 mV/°C, the TC of the Zener diode should also be negative to keep the voltage drop across Rshunt as constant as possible. The Zener voltage should therefore be somewhat less than 5 V. A 4.7 V Zener diode turns out to be almost ideal in the simulation.
The disadvantage of this circuit is the significantly higher voltage drop of almost 4 V.
6) Two Transistors + Reference
This circuit is my favorite one and I decided to build it in real world to see how it performs. Q2 compensates for the TC of Q1 and the TLV431 gives an accurate reference voltage of 1.24 V which is mainly also the voltage drop across the shunt. The quality of temperature compensation depends on the bias current and has to be verified in the real circuit if you want to minimize it. In some circuits I found on the web Q2 is a simple diode but nothing can reflect the characteristics of the BE diode better than another transistor of the same type. Especially if you use SMD you can get two transistors in one package. There is no way to improve thermal coupling any further.
This circuit is a bit more expensive than the preceding ones (mainly the cost of the TLV431, 29 cent at my local dealer, about 10 cent in production volumes) but I was stunned by the TC of the circuit. From room temperature to -50°C (coolant spray) it stayed well below 1%, that is far below 200 ppm/°C!
If you need more than one, you may share the cost of a single TLV431 connected to all of the Q2s, maybe with a small decoupling capacitor. But give every Q2x its own bias resistor or the performance may go down the toilet. Read the datasheet of the TLV regarding stability with capacitive load.
On the photo you can see I built it with THT components. Only the TLV431 is a SMD, mounted on the solder side since it is not available as a through hole component.
It is also built with PNP transistors since I needed a grounded load.
I mounted the two transistors face-to-face to get better thermal coupling. You could also put heat transfer paste in between and tie them together with a spring.
This may significantly reduce the response time according to rapidly varying loads.
The wiring side. Quick and dirty, what shall I say... The TLV431 is the small black dot on top, right from the center.
Since I do not have an environmental chamber I cannot offer you graphs of current over temperature but here you see current vs. supply voltage, rising from 0 V to 32 V. The current stays within ±10% from about 5 V to 32 V. The current is measured via the voltage drop across the 100 Ω load resistor.
Here the range 0..6 V. The sharp bend at the cursor line is where the TLV431 comes into regulation. It is at about 2.9 V what is close to the simulation results. Note that this is not the dropout voltage since we already have 1 V drop across the load.
So the line regulation of this circuit is relatively bad. This could be improved by replacing the bias resistor by another constant current source. If you have a few volts reserve, you could use the LED or Zener type which have lower TCs. Since it will only have to supply a few hundred µA, the self heating could be neglected.
Calculation of RBias
The value of RBias is initially quite uncritical. In my test setup, I simply aimed for 1 mA by rule of thumb
and came up with 12 kΩ (and it worked quite well...). I'll now explain how to do it if you want it exactly:
Initial situation: we have a supply of 12 V and want to generate a constant current of 10 mA.
A suitable transistor would be the BC546, for example. It has a guaranteed current gain of 110 (always use the guaranteed values from the data sheet, not the typical values, which will often work, but not always...). We therefore need a base current of at least 10 mA/100=100 µA. In addition, the TLV needs a minimum current for stabilization, which is also 100 µA according to the data sheet. As luck would have it, similar currents flow in both BE diodes using them in similar operating points, which certainly does not harm the temperature stability.
Around 2 V drop across the TLV431 (1.24 V) and the BE diode of Q2 (0.6..0.7 V), leaving 10 V for the bias resistor. (Attention: there is also a TL431, but it regulates to 2.5 V!)
As you can see, I have generously rounded the dimensions here. β=100 instead of 110, 2 V instead of 1.84 V, the exact value is really not important here. But you should always round to the safe side in order to create reserves instead of using them up.
RBias would therefore be 10 V/200 µA=50 kΩ, a 47 kΩ would probably be suitable, just not greater than 50 kΩ.
In my test setup I have, as I said, selected 12 kΩ, the exact value is not critical. However, it may be that a bit more or less improves or worsens the temperature coefficient, you would really have to try it out. This can certainly be done in the simulation, but if you really want to be sure you should check it in reality.
Nevertheless, please note: when comparing with real components, you are working with typical values! Namely with the transistor you just picked from the basket. With a different one or even one from another manufacturer, things can look completely different! This is not what I would call development
, this is simply trying out. Only if you try out tens of transistors or more, of different manufacturers, we may again talk of development...
The calculation for the other circuits would work in a similar way, only here you might have 1 mA for the Zener current for #5, similar for #4 and for #2 the additional current is completely omitted (but the circuit still has to draw it if you dimension RBias too small, Q2 must dissipate the excess base current).
7) Transistor + Reference
Using a shunt regulator you can also build a constant current source with only one transistor as shown on the schematic. You can consider this as a modification of circuit #2 using a (nearly) ideal transistor Q2, although one with a VBE of 1.24 V. The TLV steals
the base current of Q1 as soon as its threshold voltage is met. This is very accurate and practically independent of the temperature. So this circuit is the one with the highest accuracy and the lowest TC. The voltage drop is also in this region since below, the regulation of the TLV will not work so this circuit is only in the mean range as far as dropout is concerned. The biggest disadvantage of this circuit is, it can only be used together with a NPN transistor and it is therefore not suitable for loads against GND.
Besides this, the TLV431 cannot, in opposite to circuit 6, be part of more than one current source.
8) Other References
In many circuits you will have other references readily available that you might not think of, like in the following example:
Imagine you have some microcontroller supplied at stable 3.3 V (±4%, is this good enough?). The whole thing gets its power from a transformer which gives us an unregulated voltage of about 12 V after the bridge rectifier. Now you want to control a few LEDs with an I/O pin. Look at the circuit on the right: it is a constant current sink!
Normally, there is no need for a base resistor (except VCC may be present without VS or the collector may be 'open'). If at least, it may be kept relatively small just to limit the current to the maximum port or base current, about 47 Ω in our case (3.3V/177Ω < 20mA). This also minimizes switching times.
The maximum base current e.g. for a BC546 is at 200mA, the one for a port pin is typically 20mA. So the maximum current we get is at (3.3V-0.6V)/130Ω what makes 20.7mA and is (almost) in a safe region and I would not hesitate to eliminate the base resistor.
The controller here sets the reference voltage (its VCC) and the current will be about (3.3 V-0.6 V)/130 Ω. Simple and often useful. The disadvantage is its high voltage drop (VCC minus some 100 mV) but it is dirt cheap and dead simple!
9) PNP Transistor+Referenz (!Update!)
Only recently I learned by chance about a circuit LM4041, which is quasi the PNP equivalent of the TLV431. Here the reference voltage is not measured against GND but against VS.
This allows highly accurate current sources for loads against GND and makes my favorite (#6) obsolete to some extent.
However, it still offers advantages if your circuit is very cost sensitive (the LM4041 is much more expensive) or you can split the TLV to multiple current sources, which is also not possible in this circuit.
It always depends on the individual case.
This circuit is not part of the simulations so far but I assume it could compete well in reality.
Here a table of a few characteristics of the eight circuits:
Circuit | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|---|
Dropout Voltage | >(1 V)1 | 0.75 V | 0.65 V | 1.3 V | 3.8 V | 1.35 V | 1.35 V | 2.7 V |
Temperature Coefficient | high+ | high- | high- | low+ | low+ | very low | very low | low+ |
Line Regulation3 | ±1%2 | ±3.5% | ±15% | ±5% | ±0.5% | ±2.5% | <0.1% | ±0.2% |
Cost4 | low 8ct | low 8ct | low 10ct | low 8ct | low 8ct | high 37ct | high 35ct | very low 4ct |
The values are based on my simulations. If you have significantly different requirements you should make your own simulations and prototypes to verify the results. Use it on your own risk.
1 Dependent on part values of the voltage divider.
2 Using a regulated supply for bias supply.
3 Variation of VS from 8 to 32 V, 3.3 V kept constant.
4 Price (in €) for one piece THT at my local dealer.
A nice graph of the (simulated) temperature dependency of the current at 12 V. The numbers correspond to the circuit numbers in the text. I have trimmed the shunt resistors to get 10 mA at 25°C so all traces meet in that point.
The curves for circuit 6 and 7 show only little difference. As it oftenly is, the best circuits are also the most expensive ones. Also circuit 5 seems to perform nearly perfect but it is clearly worse in the following graphs.
Maybe I should have added, the TLV431 as a so called reference diode
in fact is a complex integrated circuit and not just a diode
in the meaning of a PN junction. But it has only two (well, three) pins and just behaves like a zener diode, only better than this (well, in most cases).
Why three? The sense pin and the sink pin are separated. This makes the zener
voltage adjustable. There are also parts that have these pins internally connected (laser trimmed to a certain voltage) and thus act as a nearly ideal zener diode.
In most cases? Well, a PN junction reacts more quickly to changes than a complex circuit, together with necessary frequency compensation. So if you have fast switching frequencies and steep edges a different circuit might be the better one.
The line regulation from 8 to 32 V. Again, all traces meet at 12 V/10 mA. Trimming of the shunt resistors makes it easy to compare the circuits this way.
In circuit 1, the voltage divider used a constant voltage, it would not make sense otherwise.
An especially bad candidate seems to be circuit 3 since the diode characteristic here strikes twice but it might be substancially improved by another constant current source supplying the diodes. But we still would have the double TC, otherwise compared to circuit 4 which would compete much better then. Just make a simulation...
In circuit 5 the line regulation can be influenced considerably by the choice of the bias resistor. A higher bias current shifts the characteristic trace towards the steeper range and might thus have a positive effect. This may however have a negative effect if you are working with a battery powered circuit.
Circuit 7 anyway takes full advantage of the ideal characteristics of a reference diode.
And finally the dropout voltage of each circuit. I used a constant 12 V supply voltage, executed a sweep for a load resistance of 800 to 1200 Ω and measured the collector voltage.
Ideally this would give a straight line of 12 V-(10 mA×RLoad). Below a certain voltage, the transistor can no longer source enough current. The collector voltage at this point is the dropout voltage we are looking for. In the graph this is at the point where the trace bends to the right. Keep in mind that this point also depends on temperature, I measured at 25°C only.
It is hardly surprising that circuits with higher shunt resistors also show a higher dropout voltage.
So circuit #5 seems to be the loser here, but if the voltage drop is not critical it can still be the better choice! In the other graphs it performs quite well and it is comparatively cheap.
In circuit #1 you can also exert influence on the trace. A higher Vref lowers temperature dependency but also raises the voltage drop. This also applies to the zener reference (#5). A lower zener voltage lowers the voltage drop but will negatively touch its temperature coefficient.
Simulate it, build it, test it and sell it...
Conclusion
Even simple
circuits like these bear a great potential of optimization. Depending on your demands you can get good line regulation, low temperature coefficient or low price, unfortunately not all at the same time. The dropout voltage may be a reason to exclude otherwise perfect circuits.
Sometimes one mA or two don't matter, sometimes VS is constant to within a few percent, but sometimes you may need it to be a little more precise....
However, always keep in mind that all components must have the same temperature, even if Q1 heats up due to its power dissipation!
The tight thermal coupling is a challenge in many cases. Especially together with a rapidly changing load this may lead to unacceptable disturbances.
It is important to use exactly the components in the simulation that you want to use in real life! It is not enough to take a standard model of a Zener diode. Especially in experiments with circuit 5 I have seen that a BZX6V2 from Rohm gives a worse TC than a 1N750 (4.7V) but a much better line regulation.
It should also be noted that all of these current sources actually regulate the current through RShunt! This is higher by the base current of Q1 than the current through RLoad, which we actually want to control. This may become relevant for higher currents and power transistors with a relatively small current gain. You may want to consider a darlington configuration as Q1 for this case, although increasing the voltage drop.
I examined a relatively wide supply voltage range here. Any of these circuits may be tuned by changing resistor values to optimally fit into your environment. The simulations should give a good starting point. Adopt them to your demands and finally verify the real circuit to be safe from surprises.
My requirements were at least 10 mA at RLoad=800 Ω and VS=12 V (yes, indeed a S0 interface). I would have chosen circuit #6 and would have had to ultimately dimension it to 10.5 mA to be safe over the temperature range, if my company's insolvency had not beaten me to it ... This would have limited the current consumption of a module (of which there were umpteen in a single device) to <12 mA (instead of 20 mA currently) and thus reduced the requirements on the power supply accordingly.
This would have made the designer of the power supply (well, me, too) happy. Only 1.5A instead of 2.5A, the transformer would be smaller, the fan can be eliminated and so on...
In your project, other parameters may be determinant...