Controlling DC Converter Modules

About: I am a retired professional engineer, now farmer. Taking an interest in all things technological and in building devices useful on the farm.

There are many types of DC-DC converter modules for sale at very reasonable prices. Many of them, like the ones pictured, include two potentiometers for adjusting the output voltage and a current limit.

This Instructable is about how to control the output voltage from an external device, which can be either a potentiometer or a PWM signal from a microcontroller such as Arduino.

There are some general principles which I will explain. Then, for each module, there are some specific requirements which I will cover for the two modules I have used, which are
a) a module based on the XL4016 IC with a current capacity of 8 Amps; and
b) a module coded SZBK07 with a current capacity of 20 Amps.


Thank you to zopinter who originally showed how to control an XL4016 module with PWM.


These modules, and ones like them, can be found on EBay and Aliexpress by searching for "DC converter 300W". I also found modules coded YD4020J which appear to be identical to the SZBK07 module.

Step 1: How the Output Voltage Is Controlled by a Pot

The way it works is this:

The pot is a variable resistance and is connected between OUT+ and Feedback. There is another (fixed) resistor between Feedback and Ground.

"Feedback" is the negative input of an operational amplifier. The positive input of that operational amplifier is connected to a reference voltage, which varies from one design to another but is usually between 0.8 Volts and 1.25 Volts. The XL4016 and SZBK07 are both about 1.2 volts.

These components form a negative feedback control loop that maintains the Feedback pin at the reference voltage. If the voltage at OUT+ is too high, the output of the operational amplifer goes down and decreases the PWM duty cycle of the converter, which decreases the output voltage. The converse happens if the OUT+ voltage is too low. Winding the voltage control pot one way to reduce its resistance reduces the output voltage; winding it the other way to increase its resistance increases the output voltage.

It is essential to have this feedback control loop formed by the pot, a resistor to ground, and the operational amplifier.

However if the pot is wound up to a high value, additional current from another source can be fed into the Feedback pin, which has the effect of reducing the output voltage.

One way of providing that additional current is by putting an external pot between OUT+ and the Feedback pin. Using a suitable value pot will give a new (lower) maximum setting for the OUT+.

Another way of providing additional current is to connect a resistor and diode coming from a PWM pin of a microcontroller. The resistor is needed to avoid drawing excessive current from the PWM pin. The diode is needed to ensure that the current is always additional.

Step 2: Controlling the Voltage of the XL4016 Module

The Feedback pin of the XL4016 module can be identified in the photo above. It is actually 2 pins of the pot (they are already joined together by the makers). I soldered an orange wire across both pins, which makes a solid connection.

The on-board pot on this module is 10K, and the resistance from Feedback to Ground is about 360 Ohms. When the pot is set to its maximum value, the OUT+ voltage should be 1.25*(10000+360)/360=36 volts, which lines up with the specification.

If you want to use an external pot between Feedback and OUT+, a value of 22K Ohms will give a maximum output voltage of about 24 Volts.

If you want to use 5 Volt PWM via resistor and diode, and if you set OUT+ to 15 Volts with no signal (ie 0 PWM duty cycle), the chart shows what minimum voltage you can achieve as a function of the connecting resistance. So for example if you use a 2200 Ohm resistor, you can control the output voltage of the XL4016 module between 8 Volts (with 100% duty cycle) and 15 Volts (with 0% duty cycle).

Step 3: Controlling the Voltage of SZBK07 Module

The Feedback pin of the SZBK07 module can be identified in the photo above. It is actually 2 pins of the pot, but the middle pin has a surface mount component (I think it is a capacitor) soldered to it, so I just used the top pin.

The on-board pot on this module is 100K, and I expect the resistance from Feedback to Ground is about 4,000 Ohms.

If you want to use an external pot between Feedback and OUT+, a value of 220K Ohms will give a maximum output voltage of about 21 Volts.

If you want to use 5 Volt PWM via resistor and diode, and if you set OUT+ to 15 Volts with no signal (ie 0 PWM duty cycle), the chart shows what minimum voltage you can achieve as a function of the connecting resistance. So for example if you use a 22,000 Ohm resistor, you can control the output voltage of the SZBK07 module between 7 Volts (with 100% duty cycle) and 15 Volts (with 0% duty cycle).

Step 4: Technical Details of the XL4016 Module

The XL4016 module is based on the XL4016 integrated circuit. Here is the first general description paragraph from the data sheet.

"the XL4016 is a 180 kHz fixed frequency PWM buck (step-down) DC/DC converter, capable of driving a 8A load with high efficienc, low ripple and excellent line and load regulation. Requiring a minimum number of external components, the regulator is simple to use and include internal frequency compensation and a fixed-frequency oscillator."

The XL4016 comes in a 5-pin TO220 package. The block diagram for its functional blocks from the data sheet is reproduced above (right side picture).

The XL4016 is designed to be used as an asynchronous DC-DC converter with the addition of an external inductor and external power diode, both atttached to the SW pin. The XL4016 provides the high-side switch in the form of a P-channel MOSFET internal to the device. That MOSFET is made with a partition to sense the current through the device and provide over-current protection.

The XL4016 module uses the XL4016 IC as its main switching control element, and adds an inductor (22 turns of 2 strands of 0.7 mm magnet wire on a T94 toriod core), a power diode (VD3, a STPS2045CT Schottky).

The module incorporates a low-side current sense resistor of 10 milli ohms, and a dual op-amp (LM358) that senses the current. If the current reaches the limit set by the current control pot, the op-amp feeds current into the feedback pin of the XL4016 IC which has the effect of limiting the current to the set value.

Step 5: Technical Details of the SZBK07 Module

Technical details of this module have been more difficult to obtain and the following information may not be reliable. However it is the best I can find. This information came from a YouTube video at

The module uses a 20-pin surface mount control IC which is probably LM25116. Originally I thought it could be type LTC1625 which has a similar function, but comes in a 16-pin package. The Description part of the LM25116 data sheet starts with the following: "The LM25116 is a synchronous buck controller intended for step-down regulator applications from a high voltage or widely varying input supply. ... The LM25116 drives external high-side and low-side NMOS power switches with adaptive dead-time control. ..."

The inductor is about 12 turns of 3 strands of 0.7 mm magnet wire on a T94 toriod core.

The power MOSFETs are type TK80E08K3, which are rated for 75 Volts and have Rds-on of 7.5 milli-ohms at 25C.



    • PCB Contest

      PCB Contest
    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest

    8 Discussions


    6 weeks ago

    Is it also possible to control the current output/ current limit with the use of a pwm in the same way as you do for the voltage? And if not, how would you do it?

    1 reply

    Reply 6 weeks ago

    Hi mr-apoptosis, Interesting question.
    When you control the output of the converter with PWM generated by a microcontroller, you can use any arbitrary algorithm to determine the PWM duty cycle.

    So, for example, if the microcontroller has measurements of both output voltage and current, the algorithm can simultaneously put a limit on both voltage and current. This would achieve the equivalent of the built-in voltage and current pot settings.

    Since these converters have a built-in current sense resistor between the IN- and OUT- terminals, and the output current and only the output current flows through that resistor, the simplest implementation of current measurement is to put an op-amp such as AD822 or LM358 with suitable gain setting across those terminals and connect its output to an ADC input of the microcontroller. The op-amp needs to be capable of outputs down to ground, and inputs a little bit below ground.

    For an example of this current sense op-amp circuit, have a look at
    Please note that this circuit is not exactly what I describe above, since the current sense is set up to measure INPUT current rather than output current. However the op-amp configuration is the sort of thing you would need.


    6 months ago on Step 2


    I am not very sure about what you say about how the pwm works.

    The feedback pin drives 2 op amps in serial (in the provided schematic).

    The first one has fixed reference voltage (1.2v), the second has a saw tooth.

    If you saturate the first op amp, it is probable that the output amplitude value will be larger than the saw tooth amplitude, meaning that the pwm signal you provide to the FB pin will be the same pwm signal that will drive the power stage.

    For this to work you must turn the pot to achieve maximal output, or even disconnect the pot from the feedback pin, because you need to saturate the op amp in both high and low states.

    2 replies

    Reply 6 months ago

    I know the control works with PWM applied to the feedback pin. The exact mechanism is a bit unclear to me. I think the sawtooth from the oscillator must have a larger aplitude than the swing of the first op amp. Maybe the response time of the first op amp is rather long, so that it effectively averages out the input PWM signal.

    Because these op amps are internal to the XL4016 device, it is not possible to do any observations on these signals.

    The pot must not be disconnected from the feedback pin, otherwise there is no control over the output voltage.

    If you are able to do some testing that throws light on how this works in detail, I will be happy to include the information in an update of this instructable.


    Reply 6 months ago

    When driving the FB pin with a pwm, there is no more feedback. In the solar application, you don't want any feedback because feedback is done by software.
    Removing the resistors and driving logic to the FB pin will saturate the op amp and will probably go through the second one. This is easy to validate with an oscilloscope


    7 months ago

    Thank you for making this instructable it is very helpful.