This is a homemade digital electronic load, sometimes called constant load controller.
In a previous video I’ve made the analog version for this device and in that case I
had very good results and I was able to get fixed value for the current from 10mA up to
5.4A and the MOSFET was always cool because I was using a big heat dissipator with a cooling
fan.
But the analog version can’t do anything more than that.
You can fix a current value with the potentiometer and it will automatically adjust the internal
circuit so the current value will always be the fixed value.
This new version is digitally controlled, and it could have multiple modes such as constant
load, constant current or constant power.
But there is even more.
This new version is also monitoring the voltage, not just the current value.
That’s why we can also print on the screen the power and that is very useful.
But even more, the voltage read is made on the main terminals but also on these compensation
terminals, because at high current values, there will be a voltage drop on the wires
and we don’t want to take that in consideration.
The controller is very easy to use with the rotary encoder.
In this video we will see how I’ve made this electronic load and I will share with
you the code for the Arduino, the schematic and the part list and the step by step tutorial.
I will also show you different ways of controlling the voltage at the MOSFET gate and explain
which one is better and why.
For more information about the analog version, please see my previous video below in the
description.
I hope that this new version will teach something new as well.
Make sure that you subscribe and activate the notification bell.
A huge thank you to all my PATREONS, So, let’s get started.
What’s up my friends, welcome back.
Let me first show you how this new version works, then I will explain the circuit and
all the components we need, we will see some examples of controlling the voltage and then
how to mount it.
See the step by step tutorial with more photos, on electronoobs.com.
Ok, so, this new version now has a case because I wanted to make it more permanent.
The case is made of plywood with some 3D printed parts and I’ve also applied a carbon fiber
vinyl to make it look better.
On the front we have two main plugs and this are the load input connections.
These other two here, are the compensation probes for measuring the voltage at the same
time.
We print the values on this LCD screen and we set the values using this rotary encoder.
So, first we get into constant load mode.
Using the encoder set the desired load in ohms.
For example, we set it to 50 ohms.
Now I apply 5V from my power supply and there should be a current flow of 100mA.
On the screen we have the setpoint for the load, the current value, voltage and power.
When the mode is running, you can still use the rotary encoder to change the setpoint
value.
By pressing the red button, we can enable or disable the load so everything goes to
0, in case that you want to first adjust the setpoint value and then enable the load.
Press the blue button and we get back to the main menu and the load control stops as well
for safety.
Now we go into current mode.
Let’s set it to 500 mA.
I connect my power supply and as you can see, we have 500mA current flow.
Even if I change the voltage from the supply, the current value stays the same because the
load will change automatically in order to keep always 500mA.
Let’s go now to the constant power mode.
In this mode, depending on the input voltage we increase or decrease the current value
so we have always the same power.
I set it to 2W and as you can see, I start changing the input voltage and the current
will change automatically in such a way that the power is always 2W.
This new version has a resolution 1mA for current, 1mW for power and 1 ohm for resistance
because I’ve used the 16 bits ADC and a 12bits DAC.
So, let’s see how to build this.
First, what we need.
I will print the values on this type of LCD screen with i2c communication, so using only
2 wires we can print the data.
The brain of the controller will be an Arduino NANO of course.
To control the menu, I will use a rotary encoder and some extra push button.
This type of encoder also has a push button inside that we could use.
To make the voltage read I will use once again the 16 bits ADC because it works great and
it has a very good resolution.
To control the load, I will use a MOSFET as before, an N channel.
We need to keep the MSOFET very cool so we need a good heat dissipator.
Once again, a very good solution is to use an old cooler form a PC that already has a
fan.
I will use this one.
We could also control the speed of this fan using PWM signal from the Arduino so when
there is no power connected, the fan will stay turned off.
We could even add a temperature sensor on top of the MSOFET so we could activate the
fan only when needed.
But for now, I will have it always turned on.
Ok, now the special part of this project.
We have a few methods of controlling the voltage at the gate of the MOSFET, using a DAC or
a PWM signal with low pass filter.
Remember from the previous project that in order to control the channel resistance of
this MSOFET we need to change the voltage between gate and source.
The higher is the voltage difference, more current could pass and that represents a lower
load.
That’s how we control the load value.
But we need some sort of feedback so we could adjust the gate voltage according to the current
value passing trough the MSOFET.
So, the options we will see now are about this feedback and the voltage control at the
gate of the MSOFET.
Let’s start with the voltage control.
In the past electronic load project, we had an analog voltage control.
We were using a potentiometer connected to an amplifier connected to the MOSFET gate.
The amplifier was always following the voltage at the source of the MSOFET and by that it
was very easy to control the current.
But now I want a digital control that would also have decent precision.
One way to control voltage digitally is using a PWM signal and a filter.
The most-simple circuit is this one, the PWM signal from the Arduino connected to a resistor
and a low pass capacitor.
I make a test with this circuit with the Arduino.
This is the signal without the capacitor.
As you can see, I can control the width of the signal with the potentiometer.
Now I add the capacitor and there you go, we now have a controllable DC voltage that
could go from 0 up to 4.5 V more or less.
If you can get to 5V you need to tweak a little bit the capacitor value.
The problem of this kind of control is the resolution.
The PWM signal of the Arduino is of 8 bits, so values from 0 up to 255.
If we want to control current up to 5A, that would be 19mA for each point, without including
the error.
But not just that, the MSOFET will be in lineal control with voltages from 0 up to about 10V,
so we can’t even use the entire range.
If you don’t need high precision or high current values, you could use this method
too.
But in my case, to control the voltage I’ve decided to use a DAC module or digital to
analog converter.
This one here is the MCP 47 25 an is a 12-bits one.
That means we have 4096 points to control, compared with only 255 values if we were to
use the PWM signal from the Arduino.
This module is controlled with i2c communication, so is very easy to control.
Just install the library and start sending values.
Is quite fast as well so let’s hope it will work.
I connect this module to the Arduinos pins A4 and A5 for data and clock.
I upload a simple code using the needed library.
Now as you can see, using the potentiometer I can set values from 0 to 5V since this module
has a rail to rail output.
Ok, all is left to decide is how we make the current read, and for that we also have 2
options.
In the last project I was using a 1ohm resistor shunt and I was measuring the voltage drop
on with the 16 bits ADC and if you know the voltage and you know the resistance value,
you can calculate the current value.
Another solution is to use this type of current sensor.
Depending on the model you could have one that goes up to 5 amps, 20 o 30 amps.
But that’s not the problem.
The output of this sensor is an analog value and the sensitivity is 185mV for each measured
amp.
So, for example, if you measure 10mA, the output would be 1.8mV, so we can’t read
this with the Arduino ADC because it is only of 10 bits and that resolution is not enough.
So, we would need to use again the 16 bits ADC.
In that case I think is better to use again the 1 ohm resistor shunt and measure directly
the voltage drop on the resistor in differential mode with the 16 bits ADC.
Ok, extra parts that we need are for example and on and off switch to turn the controller,
a 12V DC transformer to supply everything, 4 of these banana connectors, some jack connectors
for the main input wires and prototyping PCB.
So, this is pretty much all we need.
See the full part list below and also the final schematic.
Keep the schematic in front of you and let’s start mounting the circuit.
First step is to solder thick enough wires to the MOSFET pins.
In my last electronic load controller, I’ve made the mistake of using thin wires, so at
5A those would burn out quick.
Also add shrinking tube for insulation.
Remember that for more power you could use multiple MOSFETS in parallel.
Anyway, now I’ve made a small hole in the heat sink.
I ad a bit of thermal paste.
Then we screw in place the MOSFET.
For the LCD I solder 4 wires for data, clock and power.
Then I’ve 3D printed this plastic cove and placed the LCD inside with screws.
For the main circuit, I will solder everything on a prototyping PCB.
From here I will have wires connected to the screen, the encoder, push buttons and the
MOSFET.
This is the final board that has the shunt resistor, the ADC and DAC modules and the
Arduino.
Solder wires to the rotary encoder and the push buttons.
Now that we have each part ready, we need a case to fit everything inside.
I’ve used some plywood and created a case big enough to fit the heat dissipator.
I first glued together 4 sides.
Then I’ve covered this with carbon fiber vinyl to make it look better.
I’ve made a hole for the ventilator on the back and another hole on the side.
I’ve 3D printed some covers, One for the fan on the back, and another one for the hole
on the side, so I will glue these in place using some super glue.
With these the case will look a lot better.
For the bottom part I cut another piece of plywood and place a few wood blocks in order
to add the screws and join together the bottom part and the top part.
Then I cut the front part of plywood and glue the carbon fiber vinyl on top.
I measure and make holes for the banana connectors, on and off switch, the encoder, push buttons
and the screen 3D printed part.
I screw everything in place on this front plywood, all the buttons, connectors and the
screen.
I’ve soldered all the cables and fit everything inside the case.
The cooler is glued on the back part of the case, just in front of the 3D printed part
with the hole.
I’ve cut the PCB to size and then I glue it in place on the bottom plywood and then
we have a lot of wires connecting everything.
Remember to use thick wires for the high current parts of the circuit.
I’ve placed a female jack here on the back, and this will be the 12V input, and it is
connected to the main on and off switch and from here is connected to the PCB and to the
cooling fan on the back.
I’ve also connected a small buzzer to digital pin D3 for sound notifications.
The Arduino is placed in such a way, that trough this small hole, I can fit the USB
cable and be able to program the microcontroller.
Everything is ready.
Is time to upload the code.
Please go below and download this code together with the needed libraries for the screen,
ADC and DAC.
The code could always be improved, this is just a first version.
Compile, connect the USB and upload the code and let’s see the results.
I connect the 12V transformer on the back.
Then I flip the main switch and there you go.
We can see the main menu and the cooling fan is also spinning on the back.
With the rotary encoder, you can select between constant load, constant current value or constant
power.
Push the encoder and select a value.
Once selected, the mode is activated an on the screen we have the set-point, the voltage
read, the current and power.
The voltage value is jumping around till you connect something to the input, don’t worry.
When the mode is active, you can still increase or decrease the value with the rotary encode,
but in steps of just one unit.
Press the blue button and we go back to the main menu.
Using this simple menu is very easy, right?
Let’s make a test.
First, I enter current mode and set it to let’s say 200mA.
I connect my power supply with a voltage of 5V.
As you can see, 200mA are now flowing through the electronic load and we can see the voltage,
current and power on the display.
I’ve connected my multi-meter in series, so we could see good values.
While running, I increase the set-point, with the encoder, and as you can see, we have good
values.
Push the blue button and now I get into constant load mode.
I set the load to let’s say 50 ohms.
I connect the same 5V supply and there you go.
100mA are now flowing through the electronic load of 50 ohms and that’s the same exact
value on my power supply.
I can still increase or decrease the resistance value with the encoder and I can go down to
just a couple of ohms.
Finally, press the menu button and we go to the power mode.
Let’s select a constant power of 0.3W or 300mW.
I connect the supply and there you go.
Now, even if I change the input voltage from the supply, the power stays the same, the
controller automatically adapts the current value.
Once again, use the rotary encoder and increase or decrease the power value.
So, guys, I can now close the bottom part of the case.
We have 4 screws on the side.
I tight the screws and the Electronic load project is ready.
We can add labels on the front part to make it look better.
Some for the information on the screen, one for the menu button and two more for the input
terminals.
This controller can go up to 1.6 amps more or less.
But that’s because the DAC output could only go up to 5V so we can’t fully turn
on the MOSFET.
As you can see, even I set the current to 1.
8 amps, it won’t pass over 1.7.
Don’t worry, I will post a second schematic below that includes an operational amplifier
to increase the DAC output up to around 10 volts so we could go to higher current values.
By the way, in all the modes, if I press the red button, it will pause the controller so
we turn off the MOSFET and no more current is flowing.
Use this if you want to first set the value and then activate the load.
I had some problems with the sampling speed of the ADS11 15, it is a bit slow and you
will see more about this in the comments in the code, so please read it line by line to
understand more.
Well, guys this was my electronic load controller with modes for constant load, constant current
and constant power.
Check all the links below.
Consider supporting my work on PATREON, I would really appreciate that.
If you like this video give it a like and consider subscribing and remember to activate
the notification bell.
Thanks again and see you later guys.