Controlling DC Converter Modules

Introduction: 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.

Acknowledgment

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

UPDATE:

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 (the red wire). 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.

2 People Made This Project!

Recommendations

  • Lamps Challenge

    Lamps Challenge
  • Puzzles Challenge

    Puzzles Challenge
  • Rice & Grains Challenge

    Rice & Grains Challenge

52 Comments

0
DannyZeee
DannyZeee

1 year ago on Step 5

Hello,
I wish to know your thoughts on using a DAC, rather than PWM to control the output voltage? It seems as though it should be a better solution for a solar MPPT?

0
farmerkeith
farmerkeith

Reply 1 year ago

Hi DannyZeee, I think using a DAC does make sense. Maybe as simple as putting a low pass RC filter in the control line. Several people have commented to this effect, but I have not done it myself and they did not report the results so I am not sure how well that works.
Keith

0
DannyZeee
DannyZeee

Reply 1 year ago

I am pretty busy with other projects right now, but I do plan on building another mppt controller prototype. I will be using a DAC solution, will let you know how it works out.

0
juan3211
juan3211

Reply 6 months ago

Hi Danny, any news about DAC solution? Thanks.

0
DannyZeee
DannyZeee

Reply 6 months ago

No, I looked into the DAC idea, the processors I have do not have enough resolution, and, I came up with a better idea. Use the output of the MC to drive an N channel FET(connected to an RC) to pull down the feedback output, rather than driving it up. (honestly, not sure if I came up with that, or, maybe farmerkieth mentioned in once in a discussion, but, whatever, it is the current idea.) Using this approach, you can dial the output of the buck to the lowest charge voltage you would want to use, and use the MC output to pulldown the feedback. (To drive the output of the buck up) This way, you have a failsafe charger that will not overcharge your batteries if the MC fails.

0
juan3211
juan3211

Reply 6 months ago

Thanks Danny, could you share an schema (even painted in a paper, please) and the part ids? or at leats the part ids? You are talking about N channel mosfet and a RC. Is RC connected to MC output or to feedback pin of SZKB07 ? Thanks

0
DannyZeee
DannyZeee

Reply 6 days ago

I replied with a schematic, have a look, see what you think.

0
DannyZeee
DannyZeee

Reply 2 months ago

Sorry it took so long to reply, this is the basic idea.
I have not tried this yet. (Too many demands on my time) Anyone see why it will or will not work?

0
ironmike
ironmike

Reply 1 year ago

I used a PWM running at 100kHz on a nano, which gives 160 steps. I filtered it with a 3k9 and 22pF which is 100uS or 10 cycles. This is quick enough when you consider panels have ~1ms response times, and is so easy and low cost. Interestingly the PWM output point rarely moves more than 10 steps and gives an MPPT control point within 1% of optimal from 1 to 10A output at 14.0V

0
juan3211
juan3211

6 months ago

Hi Farmerkeith, I have tried your DIY project.
I have implemented a MPPT with a SZKB07 in tasmota firmware.
I have worked with an ESP8266. I have coded my own module to include in tasmota firmware. If I get managed to work with it I will publish my code to github for every body, of course.

I am measuring every 50ms the IN3221 data and adjust PWM output. (I think is good enought as "sun" doesnt change so fast.
I think I have a hardware problem, not software.
The problem is that with a 100w solar panel i can't get the MPP.
I see the voltage in the panel varies from 14.5v (for example) to 19 or 20v in the next "PWM" duty.
And the other way round.
I hardly can't see voltages around 16 or 17v. (almost NEVER)
In tasmota firmware, PWM is 4Khz, and 1024 values in PWM. (10 bits)
I have this hardware in pwm output pin: 6.8k with a 1uF capactitor (low filter) and then a 20k resistor to FB pin of the LM25116, to get from 12v to 16v

May be I have a problem with resistors? capacitor? frecuency of PWM?

0
juan3211
juan3211

Reply 4 months ago

Hi guys, any help for me? Thanks

0
juan3211
juan3211

Reply 6 months ago

Anyone? Thanks

0
juan3211
juan3211

Reply 4 months ago

Hi, anyone? Thanks

1
ironmike
ironmike

1 year ago on Introduction

The SZBK07 module is still widely available, and good value at AUD7, but seems to have its capacity largely overstated. At 10A output the hi side FET has a 45C lift. Up to this point the efficiency is good at 96%, keeping temperatures relatively low, but if you were to follow the guidance given in the devices spec sheet and took it to 15A (without a fan) you would have 0.9W in the current sense, and probably 7W in the FETs with perhaps a 65C lift. The electrolytics, although rated at 105C, would have a considerably shortened life, so I would recommend adding a 40mm fan blowing down onto the electros and FETs, which keeps the temperature lift below 40C.
farmerkeith's solution is still great for old 200-250W 30V panels.

0
DannyZeee
DannyZeee

Reply 12 months ago

Funny, I didn't see this post, until just now, but, a few months ago, I burned up one of my MPPT Chargers. Not having a spare, I thought I would just put a SZBK07 dialed to the correct charging voltage as a temporary solution, while I built a replacement for the failed charger. Some time during the day, the batteries reached full charge, load decreased to near zero, and Panel voltage rose to a value high enough to short the two caps on the input. (The current output of the buck when I initally connected it was around 13A, as I hadn't immediately noticed the failed charger, and battery voltage(4 75Ah SLA's) was down to high 11's.) So, consequenly, battery voltage again was down, due to the loss of nealy 1/3 of the charging capability. Until reading this post, I just assumed I had installed a faulty Buck. Appears as though it was overrated, and just not up to the job I handed it.

0
ironmike
ironmike

Reply 12 months ago

Hi Danny, I have burnt so many of the bucks... usually though, the JCCON caps (green and gold) on the input are really good, handling up to 42V and big ripple current no problem. If you are using "24V" panels they shouldn't go over 42Voc. There are a lot of different manufacturers for the SZBK07s though, and some may use cheaper parts, as the input caps are a big part of the cost. I think the only problem with the buck is overheating, so I use a 40mm fan to cool both the MOSFETs when the temperature goes over 50C.

0
aaklug
aaklug

1 year ago

Hi, What PWM frequency do you recomend to control SZBK07 LM25116 module using one ESP32 or arduino, for example? I tried 5Khz and 50Khz... Works fine... Lower frequencies like 500Hz,1KHz, causes some output voltage unstable.

0
ironmike
ironmike

Reply 1 year ago

There is no reason to go under 50kHz, and you get minimum ripple in a 500us filter (say 4k7 into 100nF). I use a nano, sampling output every 500us, and adjusting PWM to control current. Remember to keep the maximum delay between sampling the output and modifying the voltage at the FB pin below say 2ms or the set point will continue to hunt above and below the maximum power point, even though this doesn't necessarily have a big impact on the power produced.

0
ironmike
ironmike

1 year ago on Step 5

Recently the MOSFETs have been changed to NCE8290s: 82V, 90A, 7.5mOhm... very similar

1
DannyZeee
DannyZeee

Question 3 years ago on Step 2

Hey, I thank you for the info you have provided regarding the PWM means of control. I built a couple of MPPT Solar powered battery charging boards using this info. The problem with this method is that I need to dial the pots on the buck converter to provide the max voltage I might possible need to charge with, and use PWM to decrease that voltage to the value I wish to operate at.
The problem is, if the micro faults, output goes to max voltage.
What I am proposing is to turn your diode around between the micro and the buck, add a resistor in series between the micro and the diode(which obviously is already there), and a capacitor to ground between the diode and the series resistor (to smooth the voltage output of the micro)
Near as my logic tells me, this should allow me to set the pot on the buck to a lower voltage, and use PWM output to increase that voltage, so that if I have a micro failure, I will not overcharge my batteries. Do you see any reasons this should not work?