logo elektroda
logo elektroda
X
logo elektroda

How do you create an active load on an ESP32 using a power transistor and current control?

uasic 663 7
ADVERTISEMENT
This content has been translated flag-pl » flag-en View the original version here
  • Clarify source current limit and shunt measurement approach

    #1 21936235
    uasic
    Level 11  
    Posts: 12
    Hello.

    I want to build an active load module for the ESP-32. From what I’ve gathered, you need to connect a power transistor to the source of the device under test.
    The ESP-32 code itself isn’t a problem, but the thing is… how to physically build the module, and how it’s supposed to work.

    The project is interesting in that there’s hardly anything about it online, and it’s needed to regulate the maximum current.

    I’d appreciate some help with this.
    What voltage and current should this active load have, i.e. what is the voltage range of the source under test and what maximum current/power do you want to regulate?
    At the moment, I need to set it to 5 A at 12 V, but it could be a universal device for, say, 100–150 W.
    Is the load intended to operate linearly as a regulated ‘resistor’/constant current, or simply switch the load on and off via PWM, and do you plan to measure the current via a shunt connected to the ESP32?
    I’m not entirely sure. I’m trying to determine the maximum current the device can supply (this involves regulating the maximum current supplied by the step-down converter – controlled by a potentiometer). I need to measure the current it’s supplying (because I want to limit it to a certain upper limit).
  • ADVERTISEMENT
  • Op-amp controlled constant-current load with shunt sensing

    #2 21936322
    CHCl3
    Level 9  
    Posts: 37
    Rate: 13
    uasic wrote:
    I need to measure the current it supplies

    So you need a constant-current load with an adjustable current setting.

    In my opinion, using a microcontroller to build an active load is a bit odd, but it’s up to you. You could build one using a single operational amplifier.
    You’ll need a reference voltage source, an operational amplifier, a shunt (resistor) for measuring current, and a power transistor. The operational amplifier compares the voltage across the shunt with the reference voltage (e.g. set by a potentiometer) and controls the transistor so that it conducts the set current.
    If you really want to, you could replace the reference voltage source with a microcontroller; PWM and a simple integrator filter. But you’ll probably still need an operational amplifier to control the transistor.

    I am currently building the circuit from the link below, but using slightly different components due to availability. I need it to diagnose a power supply I am repairing.
    https://danyk.cz/zatez2_en.html

    Most of the voltage (and power) from the measured source is dissipated across the power transistor. This should be a Darlington transistor with a high β or a MOSFET. You need to find one with suitable ratings for current, voltage and SOAR. I’m currently using a TIP122, but in practice it probably won’t withstand more than 30–40 W; for now, that’s enough for me.
    The rest of the power is dissipated across the shunt resistor; you need to choose one with a margin.
  • ADVERTISEMENT
  • MOSFET-based active load with ESP32 current control

    #3 21936366
    gklub
    Level 34  
    Posts: 1811
    Help: 313
    Rate: 775
    uasic wrote:
    This is about regulating the maximum current supplied by the step-down converter

    It couldn’t be simpler ;)
    It’s not a very precise load, but combined with an ammeter it should be sufficient.
    LTspice schematic with IPT004N03L MOSFET and plots of current and power for VDD 5 and 12 V
    Essentially, you need a variable resistor and an ammeter.
    You can’t buy a 100W potentiometer, but a MOSFET can act as a substitute.
    Its ‘resistance’ is controlled by the gate voltage.
    Note how little the current depends on the supply voltage – here 5 and 12V.
    In such a circuit, the permissible supply voltage (of the converter under test) is limited by the permissible gate voltage – see the catalogue.
    The transistor used here, with a suitable heat sink, will handle 300W.
    A source resistor, e.g. 100 mΩ/10 W – theoretically, it could be omitted, but it makes control much easier.
    Resistor R2 and the diode limit the gate voltage and thus the power transistor’s current to safe levels, even in the event of incorrect voltage control at point A.
    You supply the control voltage from the ESP to point A, replacing V2 in the converter.
    You can use a different, similar transistor, but you’ll need to set the control voltage range for the specific unit you’re using.
    If you want a better solution – see Howlwnd’s source.
    There’s been quite a lot on the forum, including in recent weeks.
  • ADVERTISEMENT
  • #5 21936768
    inot
    Level 38  
    Posts: 3624
    Help: 450
    Rate: 819
    uasic wrote:
    I found something like this:

    The only thing is that it’s controlled by a potentiometer, rather than via the ESP32 as originally planned.
  • #6 21937168
    kjoxa
    Level 23  
    Posts: 610
    Help: 46
    Rate: 242
    I wonder if it would be possible to replace the component on this board with an IRFP90N20D and achieve, say, 300W.
  • XY-FZ35-35 W load limits and transistor power argument

    #7 21937265
    Jawi_P
    Level 36  
    Posts: 3265
    Help: 260
    Rate: 717
    I don’t know what kind of power supply you’re looking for, but I think there’s a special offer on the XY-FZ35-35 W 5 A on Amazon, with two-day delivery for 51 PLN.
    As the name suggests, the load is 35W max, 5A, and must not exceed 25.2V.
    Is it cheap? I don’t know; I’ve bought it and will give it a go. I just wanted to replace my old load from the ‘spider’ version with something a bit nicer, and I’d already added the parts to my basket when I came across this in the meantime.
    Front panel of XY-FZ35 electronic load with display, rotary knob, and ON/OFF button

    Added after 15 [minutes]:

    kjoxa wrote:
    I wonder if you could swap to an IRFP90N20D on this board and get, say, 300W.

    Where does this 300W come from? It’s a mistake to assume that connecting a transistor with a power dissipation of 580W would allow that much power to be dissipated on it.
    I’d go so far as to say that I’d probably be able to dissipate more power on an IRFP260 – which has half that power rating – than on the one you’ve suggested.
    Quite simply, in linear operation, that old IRFP260 will probably be better.
    If you’d suggested, for example, an IXTK90N25L2, that would be a different matter :) But the cost of the transistor is higher than that of the entire load, and the heat sink won’t be cheap either, because a standard piece of sheet metal, or one of those PC-style ones the Chinese include in the loads they sell, certainly won’t be enough ;)
  • ADVERTISEMENT
  • XY-FZ35-35 W 5 A load limits and transistor power argument

    #8 21938510
    kjoxa
    Level 23  
    Posts: 610
    Help: 46
    Rate: 242
    Jawi_P wrote:
    I’m not sure what kind of current you’re looking for, but I think there’s a special offer on the XY-FZ35-35 W 5 A on Amazon, with two-day delivery for 51 PLN.
    As the name suggests, the load is 35W max, 5A, and must not exceed 25.2V.
    Is it cheap? I don’t know; I’ve bought it and will give it a go. I just wanted to replace my old load from the ‘spider’ version with something a bit nicer, and I’d already added the parts to my basket when I came across this in the meantime.
    Front panel of XY-FZ35 electronic load with display, rotary knob, and ON/OFF button

    Added after 15 [minutes]:

    kjoxa wrote:
    I wonder if, on this board, one could swap it for an IRFP90N20D and get, say, 300W.

    Where does this 300W come from? It’s a mistake to assume that connecting a transistor with a power dissipation rating of 580W would allow that much power to be dissipated on it.
    I’d go so far as to say that I’d probably be able to dissipate more power on an IRFP260 – which has half that power rating – than on the one you’ve suggested.
    Quite simply, in linear operation, that old IRFP260 will probably be better.
    If you’d suggested, for example, an IXTK90N25L2, that would be a different matter :) But the cost of the transistor is higher than that of the entire load, and the heat sink won’t be cheap either, as a standard piece of sheet metal, or one of those PC-style ones the Chinese include in the loads they sell, certainly won’t be enough ;)


    The specifications of the IXTK90N25L2 are impressive…
ADVERTISEMENT