Building a Constant Current/Constant Power Electronic Load

A while back I built a simple constant current electronic load using an aluminum HDD cooler case as the heatsink. While it was sufficient for a few amps’ load under low voltages, it could not handle load much higher than a few dozen watts at least not for a prolonged period of time. So this time around, I decided to build a much beefier electronic load so it could be used in more demanding situations.

One of the features a lot of commercial electronic loads has in common is the ability to sink constant power. Constant power would come in handy when measuring battery capacities (Wh) or testing power supplies for instance. To accommodate this, I decided to use an Arduino (ATmega328p) microcontroller.

The schematic below shows this electronic load design. To make the schematic less cluttered, I had deliberately omitted the filtering capacitors and decoupling capacitors. I also omitted the microcontroller circuitry as it is rather standard. All the connections to the standard Arduino board are clearly marked for easy references. The Arduino source code can be downloaded towards the end.


At a first glance, the circuit here seems a lot more complicated than the simple one I built before. But the core power stage portion is actually quite similar.

I used 6 IRFP150N‘s to handle the load. These 6 MOSFETs’ are divided into three groups: each group consists of two MOSFETs paralleled together with independent gate driving resistors. The three pairs are then driven independently via three Op Amps. This design ensures equal distribution of the load current among these three groups of MOSFETs. With this configuration, the maximum power this electronic load can dissipate is at least 200 Watts for a conservative estimate.

In the circuit above, IC1A forms a voltage follower, which buffers the DAC output and the inputs of the three driving Op Amps. An LM324 is used here for the four Op Amps. Of course, the choice of the OpAmps here is not critical and you can substitute with pretty much any general purpose ones. The DAC I used is Mcirochip’s MCP4921. MCP4921 is similar to MCP4821 which I used before. The main difference is that MCP4921 uses an external references whereas MCP4821 has a built-in 2.048V reference. This is also the main reason I chose MCP4921. By varying the external reference voltage, we can strike a balance between the maximum current allowed by the electronic load and the current adjustment resolution.

In my design, the reference voltage to the DAC is provided via a resistor divider from the voltage reference IC TL431. The DAC’s external reference is configured as buffered input for high impedance so that the DAC reference input does not affect the accuracy of the reference voltage set by the resistor divider. When the external reference is set at 0.5V, the load current can be adjusted up to 15A (0.5 V / 0.1 Ohm * 3). MCP4921’s output voltage can be adjusted to upwards to either 1 x Vref or 2 x Vref, so the current range can be doubled via a software command without the need to change the reference voltage. If you do not need such a high current range, you can lower the reference voltage, it will give you a better current resolution (Vref / 4096 per adjustment step).

An encoder is used for current adjustment. By default, the current can be adjusted at a resolution of approximately 1mA/step. By pressing the encoder button, this resolution can be changed to 10mA/step and 100mA/step respectively. This makes it easier to to coarse adjustments.

Constant power mode is achieved by calculating the desired set current via the measured load voltage.

Here are some pictures showing the construction of this electronic load. The heatsink I used is a huge piece of aluminum block I got at a local auction. The original owner builds audio equipment and he used these heatsinks for his class A amplifiers. Anyway, the size of the heatsink is probably an overkill, but it certainly works nicely even without forced air cooling.


The entire control circuit is built on a protoboard. I used the Arduino board I made earlier and used headers to mate it onto the main board.

CircuitBoard1 CircuitBoard2

Here is a picture showing the finished controller board:

As I mentioned earlier, the heat sink I used is ridiculously huge, here is a picture putting everything into perspective:

This picture shows the electronic load operating in constant power mode, absorbing more than 200W of power at more than 60 Volts.


Because we are using a microcontroller here, we can add other features easily. While I did not include in my firmware code, you could easily add in a constant resistance mode for example. Or you could enable the data logging capability by writing out the current and voltage at a present interval.

The following is a short video, demonstrating the functionalities of this electronic load:

View on YouTube in a new window



Be Sociable, Share!


  1. lro says:

    Why did you place the MOSFETs so close to each other on the heatsink? This is very inefficient, if you’d have spread them out higher power dissipation would be possible.

    Also using one OP & shunt for two MOSFETs isn’t really a good idea…

    • kwong says:

      Yeah, I was trying to reuse the mounting holes on that heat sink. Yes, you are absolutely right, if I had spread them out a bit more, it could take on more load for sure.

      Regarding driving the MOSFETs, as I mentioned in my post, it was probabbly not the best approach but does allow current sharing to some extend and simplifies wiring since it allows me to use a single quad-opamp chip. But yes, if you want to take full advantage of all six MOSFETs, you really should use one OpAmp per MOSFET to allow equal current sharing.

  2. […] Building a constant current/constant power electronic load – [Link] […]

  3. […] Wong built a DIY constant current/constant power electronic load. It can sink more than 200W of […]

  4. Timmo says:

    Did you use a potential divider on A5 to allow the A2D in the micro-controller to measure voltages above it supply rails?

  5. Martin says:

    Hi Kerry,
    I would like to build this electronic load, but I have a problem with software. Library for encoder is missing. Can you send me this library, or where I can get it?
    Thank you for the answer.

  6. clcham says:

    hi, may i know the maximum voltage and current this device is capable of handling?
    also, why would you need a 500 ohm resistor in the feedback path?


    • kwong says:

      I have tested this up to 300W. One test at 60V 5A and another at 15V 20A. The maximum load this circuit can handle is limited mainly by you ability to dissipate the heat generated in the MOSFETs, without forced air cooling. Also the maximum voltage it can handle is determined by the MOSFETs you use.

      • clcham says:

        Hi Kwong, you’re using 6 mosfets, however, from the datasheet, 1 mosfet is capable of handling 100V and roughly 40A. and each of the mosfet is capable of dissipating about 140W power. Is there a reason why you choose 6 mosfets?


        • kwong says:

          You will need to check the safe operating area of the MOSFET (most device datasheets give such SOA diagram). Because the MOSFETs are operating in linear mode, there is a lot of heat generated and the SOA is significantly less than the ideal situation (where the device is used in switching mode). So in reality, you want to stay way within the SOA given the worst case scenario.

  7. Nacho says:

    Wouldn’t it have been perhaps a better choice to use the MCP4821 and then a resistor divider at the output of the voltage following OA?. That way you would not need the external voltage reference.

    Or better yet, use a resistor divider plus a potentiometer for EACH output stage, thus allowing for individual calibration of each stage to compensate R1/R2/R3 variations.

  8. mado says:

    i want to make variable electronic load for 150 watt photovoltaic (PV) panel at max 34 v , 4.35 A i did the attached circuit and i used heat sink with dimensions 17mm x60mmx30mm its form like this one…roducts_id=348 and the used resistors are 1 ohm 3 watt and mosfet IRF530 , however the circuit is not working properly i can’t control current , when i put the voltmeter on the drain i got random reading , when i turn the potentiometer i heard a sound like “Dizzzzzzzzzz” from the mosfets . i tried a pc power supply (its +12 v terminal )instead of the pv panel to give 3.8 amp and .5 v and it works very well increasing VGs increasing current and decreasing VDS till .5 volt. i don’t know what is the problem with my panel please help .
    do you think i should change the mosfets ?

    • kwong says:

      Judging from what you described here it sounds like that you have an oscillation issue. In my original circuit, the MOSFETs were driven individually and also there was a resistor at the gate. The reason for this configuration was to minimize the chance of oscillation. When you simply parallel all the MOSFETs together, the gate capacitance becomes much larger and most OpAmps cannot drive such capacitance load directly.

      • mado says:

        so what is the solution for oscillation problem ?

        • mado says:

          should i drive every mosfet by op amp or one op amp for two mosfets will be enough? by the way i used LM358 op amp.

          • kwong says:

            One or two is fine. Also, using one opamp per MOSFET is the preferred way. But in any case, you should not connect the gate to the opamp output directly, try adding a resistor (e.g. 100 ohm to 1k) in between and that is the simplest way to prevent oscillation.

        • Chris Jones says:

          I think that there is an error in the schematic diagram for this version of the electronic load, the 1nF capacitors are connected from the op-amp output terminal to the source terminal of each FET. Instead, the capacitor should be from the op-amp output to the inverting (-) input of the same op-amp, as it was in the lower power electronic load on this website. I suspect that Kwong built the circuit with the capacitors connected to the inverting inputs of the op-amps (and had no oscillation problems) whereas the schematic might be wrong, leading to oscillation problems for people who try to replicate the circuit.

          Another totally separate point: The voltage follower stage IC1A could be deleted and replaced by a wire link from the MCP4921 straight to the non-inverting (+) inputs of the opamps that control the MOSFETS. Whilst in general voltage follower buffers are helpful in avoiding loading effects with low resistance loads, in this case the load is the input terminals of other op-amps so there would be no loading problems deleting the voltage follower. There would be an advantage to removing the voltage follower because this op-amp cannot swing very well right to ground, so that with the voltage follower it might be hard to get right down to very low load currents.

          If this circuit is used with high voltage MOSFETs, watch out that some recent MOSFETs can fail at voltages, currents and powers which are all within their ratings, but outside the Safe Operating Area (SOA). See this app note, under the section “Thermal runaway in linear mode”:

      • mado says:

        take care that i used a pc power supply and it works fine, when i ncreased current to 3.8 the voltage decreased to .5 v is that normal?.
        sometimes in hanging case when the solar array was connected i turning the potentiometer there was no response but when i put the +ve probe of the voltmeter on the output of the opamp the maximum current passed related to maximum input voltage from the potentiometer

  9. mado says:

    i found on the web IRf150 and IRFP150 , are they different products or both of them can be used for linear operations

  10. mado says:

    what is the use of MCP9421 ? what is the data sent from microcontroller to MCP ?

  11. mado says:

    I see in your circuit on the output you put (load Av load ) , what could be done with this posibility ? could i use it to operate any load it’s power is smaller than the source ?

    • kwong says:

      If I understood what you were asking, the output marked as A5 VLoad means you could measure the voltage output of the load using an Arduino analog pin (must divide the voltage so that the maximum measured voltage stays within 5V).

  12. mado says:

    i have a problem with my circuit that i made an electronic load for 150 watt photovoltaic panel . i can control the circuit but the measured voltage by the voltmeter isn’t the real volt relevant to the current , for example i got 3 amp it should give 30 volt on the drain ( where the +ve terminal of the panel is connected ) but the voltmeter reads 27 volt , where did this loss go ? , i used four IRF530 but they aren’t from the same manufacturer ( they have different numbers on it) but i don’t think that this is the problem

  13. mado says:

    I need to measure the photovoltaic voltage which is the drain voltage . i used 50 watt potentiometer to make sure that the circuit is doing well ,i changed the pot to give 3 A and 30 v . but when i increase the current in the circuit to 2.5 A after this value there is a difference in the voltage on the drain and the voltage on the potentiometer by 2 volt( the circuit gave 3 A and 28 V however it should give 30 V like the pot, which mean there is drop in voltage after 2.5A is there any relation with mosfet or feedback resistor to the opamp?

    • kwong says:

      The only thing I can think of that could possibly explain this discrepancy is that there might be some kind of parasitic oscillation going on (you could use an oscilloscope to verify that), depending on the meter you used to measure the voltage you could get different readings. One way to prevent this oscillation is to “tune” the filter network (i.e. increase the gate resistor, etc.) and/or change circuit layout until the oscillation is subdued. When the MOSFET operates in true linear mode, the result you get should be identical to that when using a resistor load.

      • mado says:

        i increased the resistance to 10k ohm i also tried 1500 ohm, i also tried the circuit on test board the problem is still existed , there is around 1 volt is missed and it increased when increasing current . do you think i should try ferrite beads?

        • kwong says:

          It would be good to figure out what is the oscillation frequency as if you know the frequency you can easily change the RC frequency on the feedback loop so that the gain at the oscillation frequency would be minimum.

          Adding a ferrite bead could also help.

  14. JamesT says:

    Hi Kerry,

    Good work and many thanks for the informative uploads. I have a quick question I wondered if you could consider. I’m interested in small currents with a load such as this. You mentioned that minimum Vref on the DAC of 0.5v (set by the pot) equates to max current of 15A (0.5 V / 0.1 Ohm * 3). The follower amp will adjust output to the MOSFETS with 0.5V from the DAC. Essentially we are looking for 0.5 V across the R1/2/3 sense resistors.

    My question is one of fidelity : Looking at the IRFP150N MOSFET data sheet the min Gate threshold voltage (Vgs) is 2V. Have you seen any hunting (rapid switching of the MOSFETS) from the system in small sense feedback voltage level requirements – say a required constant current of 10mA?

    At a Vref of 0.5V the DAC resolution is (0.5/4096) ~122uV. Do you see that kind of current control resolution in practice?
    I’d love to see voltage plots of Gate voltage in these low power/current requirements – do you have any by chance?

    Thanks in advance!

    • kwong says:

      To your first question, I think you were referring to whether there was any oscillation at the gate. The short answer is, there shouldn’t be any, but oscillations with this kind of high-gain and high capacitance load (the gate capacitance), the circuit will not be stable if the snubber network (gate resistor/capacitor/etc) does not work adequately.

      I haven’t measured the current resolution of this load yet. One difficulty is the resistors I used. Because the tempco of these power resistors is high, the resolution cannot be measured accurately as the resistance variation due to temperature change will be much larger then the minimal DAC resolution. But you can easily infer the operating point of your MOSFET following the IV curve of the device you are using.

  15. mbanzi says:

    What are the specs/part no on the encoder you used?

  16. mohamed says:

    how did you choose the value of the capacitors?

  17. JamesS says:

    Hi Kerry,
    Thanks for an excellent project. It is something I have been looking for for some time now. I will be building a version of it and will be adding a few things like constant r and Battery ESR calculation but as I look through the software I have a few small questions. At the beginning of the displayStatus function you have 2 magic numbers and I don’t know where they came from. They are 0.974 and 21.91. Could you explain where they come from? Second, the selected MOSFET has a datasheet Rds ON of 0.036 ohms. While it doesn’t sound like much it is a significant percentage of the 0.100 ohm sense resistor for each pair of MOSFET’s. Do you think it makes any difference in the various calculations? Finally, it’s not a biggie, but I noticed on the schematic that the 3 pushbutton switches and the rotary encoder are routed to A0 through A3 inputs while in the software they are assigned to D14-D17 inputs. I assume the software is what you decided on as the best solution.

    Thanks Kerry!

    • kwong says:

      Hi James,

      (0.974 + 21.91) / 0.974 are the two resistors I used in the voltage divider to read back the load voltage (the two resistors are 1K and 22K but I put in the actual values to be a bit more accurate).

      The Rds on value does not really affect the accuracy as the voltage sensing is done across the 0.1 Ohm resistor. Also, Rds on is only meaningful when the MOSFET is used as a switch (on/off), here the MOSFET is used in its linear mode Rds is largely irrelevant.

    • kwong says:

      Also, to your last question, A0-A5 pins are D14-D19’s when used as digital pins.

  18. JamesS says:

    Excellent Kerry! That clears up the issue there. One lingering question – you refer to a const float EXT_REF_VOLTAGE=0.333. Where did that come from? I notice that it is used together with vSense but can’t see where it came from.

    Thanks again.

    • kwong says:

      this is the maximum voltage set for the DAC output. Since the current sensing resistor I used are 0.1 Ohm, having a 0.33V voltage across will produce 3.33A, and three sets in parallel will give me 10A. Because the DAC output can be X1 and X2, this arrangement gives me the load current range of up to 20A.

  19. mohamed says:

    if i replaced the .01 ohm resistor by .022 ohm will that need a new value of capacitor , i read in the file that you sent it depends on the load resistor ?

  20. […] them for scrap aluminum he decided to build some useful lab equipment. The first one went into the DIY Electronic Load and the second was used in his DIY Lab Power […]

  21. […] them for scrap aluminum he decided to build some useful lab equipment. The first one went into the DIY Electronic Load and the second was used in his DIY Lab Power […]

  22. Fiore says:

    Please, you can add the features of the component VR1?

  23. atsju says:

    Are you sure with the R4 R6 and C1 place on the schematic ? Is it a better design than with your first load ?
    I suppose it is to increase stability, so how do you calculated the values of these components ?

  24. PicKle says:

    Great work, Kerry! A good start point for many enthusiasts. I am more a PIC chap than the Arduino and code directly in Assembly Language. I am working on something similar at the moment although the scheme varies slightly from this project.
    I went through your video & have a couple of questions for you.
    1. Your page suggests that ‘By default, the current can be adjusted at a resolution of approximately 1mA/step’, but your video shows about 5mA/Step in the least resolution. A quick Calculation based on your response to JamesS suggests: Min Step Resolution = (0.33V*3)/(0.1E*2^12) = 2.42mA (assuming that 1X Vref is 0.33V) & this doubles to 4.84A at 2X Vref.
    2. Are the ‘Current’ Values (on the LCD) displayed from internally Calculated Math Values? There seems to be a mismatch from the calculations from the Value v/s the Displayed Value.

    • kwong says:

      Thanks for your comment. Regarding 1, you are correct that’s the result of using 3 sets of MOSFETs in parallel. The roughly 1mA/step calculation was based on just 1 MOSFET. 2. Yes, the current displayed is calculated from the voltage measurement. Because of the shunt resistor’s resistance is sensitive to temperature change, the displayed value does deviate from the calculated value a bit. To make the calculated current value more accurate, you will need to use low tempco current shunts (which can be quite pricey).

  25. PicKle says:

    Correction: 4.84mA

  26. PicKle says:

    Thanks for your response Kerry. I intend to modify this scheme slightly & thought I’d run it through in brief. Your comments/inputs would be welcome & appreciated.
    Instead of Analog Voltage generated by the SPI 12-Bit DAC (with Scaled Outputs) feeding the Current Sinks blind, A hardware generated 10 Bit-PWM (2nd Order LPF filtered) which has its Analog 0~5v Outputs attenuated to 0.33v (or any other desired Voltage to achieve Current range) would work fine although this may not be an ideal arrangement.
    The output Current (voltage sensed by 0.1E) is fed back to the MCU and is PID (or directly) controlled to stabilize the Current via PWM, would take care of such issues. In this case, a generic mid-range MCU with PWM, A2D capability & adequate Port Pins to handle the rest of the features (LCD et all) would suffice & eliminate the external DAC.
    However, to implement this, another generic Op Amp would be necessary.
    The inherent advantage of course is that the Output current (sensed via 0.1E could be displayed) would be accurate. Further accuracy could be obtained by summing sensed voltages from all the legs of the Current Sinks.
    Current Range Control for the overall System could be implemented (Ex: 0>2A; 0>5A; 0>10A; 0>20A) with 10-Bit Resolution simply by digitally altering the Attenuator which feeds the Current Sink Op Amps perhaps using Logic controlled Analog Switches such as the 74HC405X.
    The Range Control, especially the 2A> range would come in handy to test all sorts of Low Power SMPS units presently flooding the markets & claim ridiculous Continuous Power rating & capabilities.
    To enhance, better control the Current sinking, & implement Range Control mentioned above, I intend to use 4 Sections of Op Amps feeding Two IRF540(TO-220) each and raise the Current sensing Voltage to 1VDC using two 0.1E/5W/1% resistors in series (since 0.2E/10W/1% is hard to come by). These HEXFETS should have no issues delivering 2.5ADC which are well within its SOA (DC) Limits.
    A few other less significant hardware & firmware features I plan to implement are:
    1. Addition of an extra Switch to Cycle the Current Range/s
    2. 16×2 Serial LCD via 2 Port Pins for Display
    3. Last Settings saved into EEPROM and recall state after Power-up
    4. Shaft Encoder Button to Cycle Step resolution (courtesy: your idea)
    5. Overload Limit/Shutdown: Feature comes in handy in case PSUs are tested beyond 20A Limits
    6. Inexpensive Bimetallic Switched 220VAC 80x80mm Fan which turns on if temperature exceeds 60’C
    7. RS-232 Configured for Data Logging (V/I Values) purposes (would be my last part of implementation)
    Shall keep you posted as things develop & take shape. Do let me know if there are some handy features I could implement whlile am still at it.
    Thanks in advance

    • kwong says:

      Awesome. Can’t wait to see your final build!

      The only thing to control the current from the measured voltage via an MCU is that the transient response would be pretty poor and could lead to potential oscillation when the DUT’s load characteristics change rapidly.

  27. PicKle says:

    You’re right Kerry, I agree. However, I have considered two practical factors:
    1. Manual Inputs to vary sink currents with the highest selected range would be a maximum of 100mA/Step. Shaft Encoder Manual Stepping via 180Deg/realistic rotation would result in 24 pulses (considering a 24PPR Shaft Encoder, this would translate to about 2.4A/Second; worst case scenario). This would mean that the PID loop would have to stabilize the system within 42mS per step-point. This shouldn’t pose any firmware issues, theoretically speaking. I intend to use a mid range PIC MCU running at 20MHz. I am yet to analyze the firmware’s transient behavior. Shall keep you posted as things develop.
    2. Since the system I intend to develop is primarily intended to test the Load regulation & stability of power supplies, applying a Step Load via this system is manually impossible, but possible to implement via firmware. Thanks for that input though; I could pack in that feature as another mode of operation, perhaps in the Constant Power Mode. Having said that, practical realization of this would be quite a challenge, I admit.
    3. At present, the maximum practical voltage & current sinking of the system (limited by MCU voltage/current sense & NMOS-SOA) is 50VDC and 20ADC respectively.
    Could you (or other members of this forum) suggest devices other than Batteries, Solar Panels, etc. which I could test & help enhance the system’s performance?

    • kwong says:

      The only other thing I could think of to facilitate your testing is using a high current adjustable lab power supply so that you can test the performance of your load at different voltages.(depending on the MOSFETs you chose, the minimum load voltage required is at least a couple of volts)

  28. PicKle says:

    Of course! Ironically, I’ve made myself a Variable 200W SMPS (50V/4A Buck Mode) PID Controlled Split Power Supply with integrated Current limit, etc., has a power conversion efficiency better than 70% & works like a charm. I made it a couple of years ago and has proven to be quite indispensable. At lower voltages, it delivers more current due to its inherent design.
    The CC-CP Electronic load, I intend to develop would be another ‘one of a kind’ tool for my personal R&D use & hope the build turns out as well as expected.
    If ultra-precision isn’t necessary, why buy an expensive tool when we’re capable of making one that suits our purpose fine, Kerry?

  29. PicKle says:

    Ideally, I would have rather used High voltage ‘Audio’ transistors or MOSFETs which suits this application like a glove. But they have become scarce and/or frightfully expensive. IRF(P)150/250 have relatively high Ciss which could present a drive problem, unless of course, one Compensated OpAmp is used to drive each of the MOSFETs. I wish to retain the equipment relatively compact; hence, my selection of its cousin, ST’s IRF540 (STripFET with about 900pF Gate capacitance) which was perhaps, the last of the ‘modern’ MOSFETs used in Linear Mode Audio application which I have recycled from Electronic waste.
    Could I post/share a link or two in your forum as my build shapes up to help fellow enthusiasts?
    Kerry, thanks in advance for your support.

    • JamesT says:

      Hi PicKle,

      just revisited this forum and wondered how you got on with your design? Especially interested in the transient response you briefly discussed. Did you post any further updates on your progress?

  30. PicKle says:

    Kerry, in the Schematic hosted on this page, Compensation Capacitors C1, C2 & C3 seem to appear in parallel with the Ciss of the MOSFETs?

  31. Mester Kemo says:

    Hi kerry
    great project
    can i use 4 IRFP150 with 2 IRFP250, or 6 IRFP460 that i already have.

  32. Matthew Sainsbury says:

    Why are the sense resistors connected to ground? It looks like the path is ground->sense resistor->mosfet->load->ground. What am I missing?

  33. Ayush says:

    What are the specs of the resistors you are using? Should the temperature coeff be taken into account to prevent current changes due to heating?

    • kwong says:

      Yes, ideally you’d want to use low tempco resistors. The resistors I used were just typical ones and thus the current measurement is not very accurate since the shunt gets pretty warm under load.

  34. Mester Kemo says:

    Hi kerry

    i apply the circuit but when i turn on there is short also when is connected to power supply didn’t show my the voltage (because there is short)
    and the (v load ) is connected directly to A5

  35. Mester Kemo says:

    When i turn on there is a volt around 0 volt (0.60mv) in output and the output at opAmp is 10v (7,8 on circuit ) but the problem is there a short

    • kwong says:

      Try disconnecting the load MOSFETs one at a time (disconnect drain or source). Sounds like one of the those MOSFETs are shorted.

      To confirm, you can measure the resistance between D and S using any of the onboard MOSFETs, and the resistance should be infinite.

  36. LukaQ says:

    What is the lowest current you can set and output will sink it?

    I’m using just op amps and mosfet (no arduino part), first buffer – follower has input to GND, I get around 60mA. would I need different op amp for even lower min load?

  37. Harley says:

    Can you elaborate on the circuit used to take the voltage measurement across the sense resistor(s)? I have been working on a very similar design, and I have two final hurdles. One is that my load resistors are actually kanthal coils, which heat up under a given load and change resistance. I just need to either keep them cool, or go to a more stable load resistor setup.

    The bigger hurdle has been a safe way to measure the voltage drop across that sense resistor. I need to read that into the ADC(s) on an AVR uC without risking the high voltages crossing the uC. My load circuit is nearly identical to yours, and uses a 15v source to control the current. My control circuit, where the uC resides, is a completely separate board with a separate 10V (to provide +/- 5V) source.

    I have looked in to a lot of options, such as instrumentation-amp setups, but everything requires that the measurement circuit share a common ground with the measurement target. I would like to avoid this, as it introduces the possibility of injecting high voltage into my control circuit.

    Obviously, I’m not well versed. I just like to tinker and learn, so the solution is probably obvious, but several forums have come up short, so any help would be appreciated.


    • kwong says:

      Hi Harley,

      What you could do is to introduce a 100 ohm to 200 ohm resistor and then put a 4.7V Zenner diode right at the input to the ADC. This way should the input range exceed the Zenner voltage, the voltage at the ADC pin will not go much higher than 4.7V. This is probably the easiest way to safe-guard against accidental damage to your MCU.

  38. I have a question:

    I want to connect R1 to R3 together. Is this possible? I want to use this configuration for resistor R1,R2,R3 and measure the voltage across this resistor with an ADC chip (MCP3201)

  39. Jim says:

    Can you give an example of a suitable encoder for this project?
    Thank you

  40. Jim says:

    Can you clear up a couple questions for me?
    1. Which is right for the C1, C2, and C3 Caps? Should they go from the Op Amp out to MOSFET Source like the schematics, or should they go from the Op Amp out to the Op Amp inverting input like your simple load circuit?

    2. What should the TL431 reference voltage output be to the MCP4921 VRef pin 6?

    3. What tolerance resistors and caps should be used?

    Thank you

    • kwong says:

      Hi Jim,

      To answer your questions:

      1. The values depend on the OpAmp/Layout of the circuit as their sole purpose is to prevent oscillation. You can start with 1 to 10 nF and usually any values within that range should work. But if you do encounter instability issue, you will need to adjust the values.

      2. That depends on how much current you want the load to draw. Because that voltage is directly compared against the voltage drop across the load resistors. So if your load resistor is 0.1 Ohm, a 0.1 volt drop across a single load resistor would correspond to 3A setting (because there are three in parallel).

      3. The tolerance isn’t really critical, for the current sensing load resistors, if you could get low tempco ones that would be ideal. The actual value of the current can be calibrated in software.

      Let me know if you have any questions.

      • Jim says:

        Thank you, but for question one, I was more looking for the connections. Caps C1, C2, C3 from OpAmp Output to the MOSFET source or to the Op Amp Inverting input?

        • kwong says:

          Sorry, forgot to answer that question. The short answer is either way is fine (if you take a look at the ST app note linked above, you will see many different ways to compensate for loop stability). In my schematics, these three capacitors are connected to the inverting input via resistor (R6, R9 and R12).

  41. Matt says:

    Hi Kerry I would like to first off thank you for sharing you hard work
    I have built the load and it works perfectly but i would like to add a constant resistance mode, with this being my first experience with a mcu could you possibly point me in the right direction of how to implement this into the existing code.

    Many thanks matt

    • kwong says:

      Hi Matt,

      For constant resistance mode, you will first need to consider the range you want to implement. For instance, you can choose the range to be say between 1 Ohm and 1K and when the supply voltage is 10V, the resulting current would be between 1 mA and 10 A. Use the encoder to select the resistor value then you can calculated the desired set current. Once the set current is known, you can use the method similar to what I used in the constant power mode to set the DAC value. Hope it helps.

    • Jaqb says:

      Hey man, could you send me some detailed photos of your finished project from the front and back, preferably high resolution? I would be very very thankfull

  42. Jaqb says:

    I am IT guy wanting to re-create this wonderfull piece of hardware (my only expirience in electronics is a couple working projects using arduino and sensors from ebay, like controling devices in my house via the internet, weather station with self updating website etc.) So my knowledge is pretty low. I already have all of the components needed, only obstacle for me is schematics, I cannot just read it and build working circuit. Do you maybe have some more detailed schemes containing everything from working project? Or those not so detailed photos are everything?
    I would be very thankfull if you could share something more with me.

  43. Hi Kerry,

    This is a great constant current load project. Nice work. I’m just wondering about few things that could sound ridicolous: why it’s all digital? I love the “old crappy pot” way. I would build this project in a romantic, inaccurate analogic way: do you think the VRef set by 10k potentiometer solution – that you presented in the previous version of the dummy load – could be implemented here instead of that “too much digital” things? Have you any suggestion to do that in a analog/minimalist way? Thank you very much.

    • kwong says:

      Of course, You can always replace the digital pot with a good old potentiometer, you just won’t be able to set it programmatically. But sounds like you don’t need the programmability anyway.

      • The answer lies in the folds of my years: I don’t have the skills – and I’m not ashamed admitting it – to manage digital equipment “from inside”, even though I pretend to be a programmer since 1981. I try to build functional devices without any dangerous increase of my mental faculties, ’cause my brain could explode in a multicolor halo. Ok, just joking. Despite of the age, I’m still learning, and the next step will be certainly taken with a pike dive in uP programming. At this time I need to revamp my small, ridiculous electronics skills just handling friendly devices with many leds (awww… leds!), huge resistors (used as heaters) and other window-throwable stuff. So, after a satisfying journey deep into the power supplies underworld, I think this dummy load certainly worth a try, but I first build it in the grandpa’s analogic way, and maybe next I’ll push it in a digital nightmare.

  44. Jim says:

    First, thank you. I am trying to program the Arduino Duemilanove. I am getting errors.

    ElectronicLoad:42: error: ‘Encoder’ does not name a type
    ElectronicLoad.ino: In function ‘void getCurrentEncPosition()’:
    ElectronicLoad:79: error: ‘currentAdjEnc’ was not declared in this scope

  45. […] seemed to be the Dave Jones’ EEVBlog project. But yet it was too small. Finally I found the Kerry D. Wong’s project, who designed exactly what I needed. But there were another problem: it was engineered to be used […]

  46. […] I wrote in the Episode 1, this project is based on the constant current electronic load designed by Kerry D. Wong. I won’t repeat what he already explained in his blog. Furthermore, I haven’t enough […]

  47. NK says:

    Hi, I have a couple of questions regarding the circuit.

    1. How does the circuit handle ground noise voltage (in simulation I used a voltage source of 50mV – 200mV between current sense resistor and GND) ? My simulation results gave me reduced current with higher GND voltage. If this happens in the field, how to isolate the circuit from GND noise from current path ?

    2. How does the circuit behave under no Input Supply Source at the Drain of the MOSFET but the other circuitry is powered ? Again, in my simulation and a small test circuit I built, what I observed was that the current sense feedback circuit would sense no current flow through the resistor and hence the GATE drive circuit turns the MOSFET ON instead of operating it in linear mode. When power is applied to the Drain of the MOSFET, the current output goes in to oscillations. Have you experienced this ? If yes, is there a fix for the same ?


  48. MihaiC says:

    Thank you for posting your work here and sharing your knowledge with others.

    I think something is wrong in your code regarding the debouncing of buttons.
    I couldn’t manage to get it working so I approached another way.
    I split the for() loops and used the library provided here
    Now it is working as expected.

    Best regards,

Leave a Reply