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.

ElectronicLoad

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.

MOSFETsHeatSink MOSFETSBoard

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:
CircuitBoard3

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

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

ElectronicLoad200W

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

Download

ElectronicLoad.tar.gz

Be Sociable, Share!

131 Comments

  1. Rob B says:

    First of all a huge thanks for publishing this design. I have already purchased the major power components to build my own. I am also trying to spin up a PCB and have it fabbed up in one of the online board houses. While waiting for all the components to arrive I have had a play with your code on an UNO with the ADC, encoder and reference connected. The problem I have is the rotary encoder seems to be totally ignored. The encoder I have is this one http://image.dhgate.com/desc_398209987_00.jpg The pins are labeled +v, gnd, SW,CLK and Data At first I thought the switch was faulty or incompatible but it seem to work OK with the basic test sketch provided in the library (Teensy PJRC) I tried removing the encoder from the PCB to use it ‘naked’ also with a Arduino Mega to with no improvement. I would greatly appreciate some help getting this to work.
    Thanks
    Rob

    • kwong says:

      Hi Rob,

      These encoders typically have 5 pins. I am not sure how the board is routed, but the one side with three pins are the side for the encoder, with right pin being common and first two pins for the gray code output. The other side with the two pins is the switch. Could you trace those pins and see if the connection is correct?

  2. Rob B says:

    Hi again Kerry. It looks like I have found the issue with the rotary encoder. I have spent the last two days wrestling with this issue only to find the problem lies with the newest release of the Arduino software. By recompiling with 1.05 the encoder now works. I tried this approach after reading a comment from the encoder library author that using the polling method is highly dependent on a fast main loop time. I suspect with all the latest ‘improvements’ the compiler is not as well optimised as older releases. To test this theory I might try the code on my DUE or Teensy3.1 Actually if the Teensy was localy available here I would simply embed that as it has a native DAC so it might be possible to eliminate the Vref and external DAC needed for the Uno
    I would be interested to see If you have any luck using the latest Arduino software.
    Thank you again for the time and effort in creating and sharing these projects.

  3. theslowdiyer says:

    Hi Kerry,

    Very interesting article/build, thanks for publishing it. You mention that you have omitted some capacitors from the schematic, is it only the standard supply decoupling caps on the opamp/DAC/78L05 and the LCD that are missing or is there something else? Otherwise is it as simple as hooking up the Arduino and loading the code?

    Seriously considering laying out my own PCB for this design :-)

    BR,

  4. steven says:

    Hello Kerry,

    What is the maximum input voltage for the electronic load ? Current and voltage are limited by MOS or software (or both) ?
    Thanks your help.

    • kwong says:

      Hi Steven,

      The input voltage is limited mainly by the MOSFET. Since I used ATMega328p’s analog input pin to sense the load voltage, you will want to adjust the voltage divider (and the software constant) if you want the load voltage to be higher as the input can’t go above 5V.

  5. Sujeeva says:

    Hi,

    I programmed an Atmega328p with compiled code (Arduino 1.05 with added Encoder Library works OK).

    I assembled the project in a Solderless Board for the test (I am still waiting for the DAC chip to come).
    MCU (Atmega328p) with All 3 Switches and the Encoder along with the LCD works OK.

    I have a few points to get clarified before going ahead as I am using an Atmega328p stand alone instead of an Arduino Module.

    1:Connecting A5 (Pin 28 of the MCU) to GND Load Voltage comes to 0 but when connecting it to VCC (Pin can’t go above VCC) the voltage goes to 117.3V obviously a voltage divider is needed , A5 (V Load) in the schematic appears to go directly to A5 input,What should be the Voltage divider ratio ?.

    2;LCD (1602 LCD Module) pin 5 (RW) is not connected in the schematic but it had to be connected to GND.

    • kwong says:

      Well.. the divider ratio is up to you as long as the ratio you use is relfected in code. So if your maximum load voltage is 100V you will need a 19:1 ratio divider so the input to the analog pin does not exceed 5V.

      • Sujeeva says:

        Hi,

        Thank you for the support,
        It works and the voltages given appear correct.
        To complete the project I have to wait until the DAC arrives from ebay(Another 2-3 weeks).
        I am using a 16MHZ crystal is it correct ?.

        • Rob B says:

          Yes 16MHz is the standard Uno clock frequency. I am using a 16 MHz Nano for my build.
          I also used an I2C 20×4 LCD. This frees up a bunch of IO’s that can be used for other functions and display ‘soft’ key legends on the LCD.
          In testing I have found an old school AMD CPU cooler and fan is ideal for two mosfets and up to 250W dissipation. So with 3 coolers 600W disipation should be achievable. The current crop of Intel coolers are too small to mount two mosfets and are likely to be less effective at heat dissipation since modern CPU’s are more energy efficient. IRFP640 mosfets might be the optimal mosfet to choose with a quoted 300W max dissipation each althogh I have not tested them.

          • Sujeeva says:

            That means you are using a serial LCD module that can be connected with just 4 wires instead of 10 wires needed for a parallel LCD.16×2 LCD shows 2 display lines.Does 20×4 LCD show any other information ? and if so how did you connect the module ?.
            With regard to the MOSFETs I prefer those with TO-247 or TO-3p case instead of TO-220 as I have experienced frequent failures of TO-220 MOSFETs under high power even when used within the ratings whereas TO-247 and TO-3P are very reliable (May be the surface area).
            In addition I expect to see how IGBTs behave here those may not be suitable due to high saturation voltage and the reading may become inaccurate at lower voltages (AS the current is not sensed through a load resistor).
            I have a large enough heat sink for the project.
            I hope the DAC will arrive soon for me to complete and run a test.

            I am looking forward to see if someone add a Constant Resistance mode as well.

  6. William Gordon says:

    Hi Kerry…
    We are considering using your circuit but beefing it up to be able to handle loads up to 500VDC @3.5A. Our guys seem to think that if we choose higher voltage MOSFETS, caps, etc. and add some isolation to protect the higher voltage that this might work.
    I was wondering if you would have any thoughts, comments, or suggestions about doing this. If we do this successfully, we will spin PCBs, do a sheet metal chassis/enclosure, and make this almost like the old Heath Kits from years ago. And of course we will share the final design(s) for others to utilize.
    Thank you for any help or direction you can provide…

    William H. Gordon
    Power-Plus

    • kwong says:

      500V @3.5A that’s 1750W maximum power dissipation!

      In principal similar designs with lots of high voltage MOSFETs carefully balanced in parallel should work, but I think you will need a much more robust design. For instance, if a MOSFET fails (e.g. DS shorted) it would short your 500V voltage rail which could cause some serious damage due to all the energy dumped in at once. And without proper isolation, this could be quite dangerous as well.

  7. Sujeeva says:

    Hi,

    I am having a problem with the Reset switch S1 in CC mode, It brings the display to 0 but the load current stays as such and it needs to rotate the encoder at least one step in either direction to stop the load current, I found that connecting a Diode from A0 to D5 (Cathode to Anode) fixes the issue.

    I can’t find any fault in the circuit either.

    The CP mode works perfectly.

  8. Joseph Burgio says:

    Hello, I am sorry To bother you but yes i am making this too! I was wondering instead of the irfp150n if i could use a cheaper IRF540n.

    • kwong says:

      Correct. -40 V comes from the negative side as you can see from the last picture.

      The current and voltage controls do not use pot, they are rotary encoders. The pot is for adjusting the contrast of the LCD.

    • kwong says:

      You sure can. Those were just the MOSFETs I had on hand. As long as the MOSFETs are adequately rated, you should be fine. These linear loads can use pretty much any MOSFETs.

      • Joseph Burgio says:

        I am sorry, I never used a Rotary Encoder, Is the encoder ENCA and ENCB

        • kwong says:

          Correct. Those two are the encoders for controlling voltage and current settings.

          • Joseph Burgio says:

            Thank you for all your time :) That should be all my questions for now! Well i mean until the parts come in! But would you advise against Designing an etching my own board due to the high current? or do you think it would be okay using thick traces?

          • kwong says:

            Thicker and wider traces are definitely beneficial, you can always solder on additional copper wires (or just tin the traces) to increase current capacity if needed.

  9. […] could more easily tweak for myself. A bit of googling turned up a few promising pages, most notably this one on Kerry Wong’s (excellent) […]

  10. theslowdiyer says:

    Got my prototype boards nearly ready, but I need to do the mechanical stuff and tweak the software for use with an I2C-display before I am ready to test.

    Apart from my “tweaks” I’ve followed the schematic as published (including the A5 connection directly to the load-input), so is there anything I need to be aware of before I plug it it to prevent it from blowing up? :D )

    Link to my small writeup of the progress and pics of the board: https://theslowdiyer.wordpress.com/2015/08/04/building-an-electronic-load/

    Thanks in advance for any comments,

    /U.

  11. gunche says:

    What function have C1? Is it reduce AC resonance in the opamp or decoupling feedback signal? Is it connected right, it is in serie with the 500 ohm…
    Why is R6 so small 500ohm why not 10K?

    Hope you understand.

Leave a Reply