Having the capability to source or sink current can be a really useful when dealing with several aspects of electronics - from easily driving LED's to putting a load on a power supply or driver. We'll cover exactly why you might want a constant current sink, as well as how to build one.
Constant Current is Good
In some labs, you'll find hefty bench power supplies capable of supplying constant current of several amps (or more) at any desired voltage. These are great for quickly testing circuits during initial power-on, as well as controlled experimentation. But, what if you don't have several hundred dollars (minimum) to spend on a heavy-duty bench power supply? Or if you'd like to source a constant current on a more permanent basis - you certainly don't want to be tying up that nice bench supply. . .
Our initial requirement is to provide a constant current to our copper electroplating tank. If you're familiar with the process, you'll remember that the ideal current for our bath is around 10 Amps per square foot of PCB surface area. If we have a relatively small board of 4" x 4", we wind up needing a little over 2 amps of current for plating. The first thought would be to pick a power supply capable of supplying the necessary current, then throw some current limiting resistors at it. So lets take a look at this option. If we take a look at the 5V output of a standard computer ATX power supply, there's plenty of power available.
watts of power across our resistor and that we'll need a 2.5 ohm resistor.
V = I * R
R= V / I
R = 2.5 ohms
OK, that was easy enough - so we'll order a 2.5 ohm power resistor and call it a day. . .until we need to control a different amount of current, that is! We're obviously going to need a different value power resistor for each different amount of current we'd like to sink. On top of that, we'll also need a different value if our load has a different resistance (it contributes to the series resistance in this case). What we wind up with is a fairly large pile of costly power resistors, along with a lot of time in connecting them to heat sinks, etc. Wouldn't it be nice if there was some way of controlling the current without changing these resistors, almost like having a high power potentiometer.
Flexible Constant Current Circuit
Enter the constant current sink. As it turns out, we can control the amount of current flowing through a load fairly easily. By using a transistor to turn various amounts(and using closed loop feedback) we're able to control the amount of current flowing through a load very well. This simple circuit has only four main elements:
- Op-amp - to provide the control for limiting the current
- Current sensing Resistor - for providing a small control voltage to feedback to the op-amp representing the amount of current flowing through the load
- MOSFET - acting as a variable resistor (because the op-amp isn't letting it turn on fully) that limits the current flowing through the load
- Potentiometer - A variable voltage divider that sets up the desired current through the load.
Theory of Operation
Our constant current source is primarily a voltage follower. Op-amps generally try to make the inverting input the same as the non-inverting input - also referred to as the virtual short circuit approximation. Setup as a simple voltage follower, the op-amp will provide enough voltage on the output pin to make the inverting input the same voltage as the non-inverting input.
With a traditional voltage follower, the output is tied directly to the inverting input, producing the same voltage on the output pin as the non-inverting input. We're going to do something very similar here, but instead of getting feedback directly from the output, we're going to take it from the current sensing resistor. The op-amp will still adjust the output voltage in order to maintain the same voltage on the inverting input as the non-inverting input, which means we now have a way to vary the gate voltage on the transistor to keep the voltage across the power resistor constant - since our power resistor's resistance isn't changing, we've got constant current!
Some thought should be put into the power resistor used, since its value will greatly influence the maximum current, resolution, and power dissipated. The initial application for this circuit is going to require around 10A or so. This should enable us to plate a double sided board up to a 12"x6" at 10 APSF (amps per square foot), which is way larger than needed.
Given the the same amount of current, a larger value resistors are going to need to dissipate more (wasted) energy as heat than a smaller one (P = I2 * R ) - so a small value resistor is desirable for low heat dissipation. However, as the resistor gets smaller, the voltage drop across the resistor (which is used for our feedback signal) also gets smaller (V = I * R), so we don't want to go "too small" or the feedback signal will be in the noise.
We'll start with a 0.1 ohm resistor and run some numbers.
Given our target of 10 amps, we'll assume a 3.3V positive voltage source.
P = I2 * R
P = 102 * 0.1
P = 10 watts
V = I * R
V = 10 * 0.1
Feedback voltage at 10 amps = 1V
Although we'd really like to see a larger feedback signal, we don't want to dissipate too much more energy as heat, so the 0.1 ohm resistor seems to be a fairly decent choice. Also, since it is 0.1 ohms, you'll notice that the feedback voltage is simply 1/10 the current, so it will be very straight forward to use a volt-meter to measure the feedback signal and do the math in your head.
If this feedback signal were going into an ADC, it would be desirable to fine-tune the full-scale feedback voltage to the rails of the ADC reference voltage - for instance, if you have an ADC with a reference of 0 - 5V, then yo'ud like your feedback signal to go from 0 to 5V. This is easily done with a non-inverting op-amp, but since we're not concerned with digitizing anything here, we're going to skip this step.
The resistor we wound up choosing is a 0.1 ohm 36 watt power resistorin a T0-220 package (manf p\n PF2203-0R1F1)
. This allows us some overhead, as long as the resistor is kept cool.
We're going to be using an N channel MOSFET for the transistor. This selection will allow us to easily change to a pulsed constant current sync if we want to later on. Again, we'll be going with a TO-220 package for the heat dissipation. Looking to see what's available and reasonably priced turned up a 78A 30V MOSFET(manf p\n IRLB8743PBF) - again plenty of headroom and at under $2 - it's not going to break the bank. . this transistor can also dissipate up to 140 watts (provided it is kept nice a cool).
A rail-to-rail, single supply op-amp is going to be used here, it would also be good to have a fairly low input bias voltage offset, but this is a secondary requirement. We want something rail-to-rail so that we can go down to the negative rail and still have useful output - this should allow us to use the circuit for lower currents. It is desirable to have a single supply op-amp so that dual rails aren't required - this will also allow us to simply tie the output of the op-amp to the gate of the transistor. A low input offset voltage would ensure that what we're asking for on the input is what's going to come out on the op-amp's output. Since, in this simple application, the loop is going to be closed with a voltage reading across the load resistor anyway, the low offset voltage isn't too much of a concern, since it will essentially get calibrated out.
A MCP6292(manf p\n MCP6292-E/SN) is going to be used as our op-amp. We've added some footprints and passives on the un-used channel according to our writeup on properly terminating un-used op-amps to make it easier to add in additional functionality, as well as prevent some misbehavior caused by undefined inputs.
Dealing with the Heat
Since this solution is linear, there's going to be a lot of power thrown away in the form of heat - we are essentially using the MOSFET as a variable resistor, after-all. All of this heat has to be dealt with somehow. In the spirit of getting something together quickly, an old Pentium 2 heat sink is going to be used as the heat sink, along with an old fan that was laying around in the same box. 4-40 threads have been tapped into the heat-sink to enable screwing the FET and resistor down tightly. Note, the tab on the transistor is connected to drain, so some Kapton tape or other material (there is also pre-cut material for TO-220) to isolate the tab is necessary, along with a shoulder washer to keep the screw from coming into contact with the sides of the hole wall. The resistor's tab is electrically isolated, so that won't be a concern.
OK, so going through the calculations is all well and good, but what the heck are we going to use to supply all this current? An old computer power supply is an excellent choice. More than likely, you already have one of these laying around in or out of an old computer. If not, they can usually be found second hand, even new ones can be had online for around 10 USD.
Here are the spec's on a $10 supply (we used an old 250 watt supply in the prototype build):
A quick and dirty prototype was milled and populated with a few minor issues - mainly due to the fact that the PCB didn't have plated through holes! The pot and transistor had rocked loose and broke solder joints because they had only the surface pad to make contact with - plated through holes would have provided enough support that the pad wouldn't have lifted, breaking the joint.
A few 4-40 holes were tapped into the heat sink - after 6-32's were mistakenly attempted. . .that's where the extra ones came from. The fan was simply attached with zip ties. One large zip tie was wrapped put over the heat sink and board so the weight of the heat sink wasn't supported by the solder joints of the transistor and resistor. The board and heat sink assembly is attached to an old ATX supply - we now have a well-controlled constant current "source" to use!
Real World Results
The circuit winds up performing quite well. At 9 amps for a couple of minutes, the only thing that is noticeably warm are the small connectors (which are only rated at 2A!). The actual connectors used in this build are not rated for the current the circuit can sync, but they do provide convenience during quick tests - they'll be removed or replaced if large currents are needed for more than just a test.
Two main things are limiting the total current output of this circuit - connectors and the power resistor. The small .1" headers are only rated for 2 amps. Since the resistor we chose is only rated for 36 watts, that will hit it's limit at around 19 amps or so. Because we used a low value resistor (0.1 ohms) the actual current limiting because of this resistor will be 33 amps if the 3.3V supply is used, so that's not too much of a concern if you're using an ATX supply. Also, the 0.1 ohm resistor provides a feedback voltage that is 1/10th the current, so our rail-to-rail op-amp is able to control the voltage going to the base of the FET for currents up to 50 amps.
Like any first cut, this circuit has lots of things that could be improved upon. An MCU could be added to provide real-time control over the current, display, ect. A dedicated panel meter could be used if MCU control wasn't necessarily desired, it could be packaged nicely/more robustly. The list is nearly endless.
So, if you ever find yourself in need of a constant current source or just a constant current load, give it a shot! Also, if you have any suggestions or comments, give a shout in the comments or the forum.
Eagle SCH and BRD files can be found in our hardware SVN repository. This article references revA of the board.