Control voltage AND current of a DC Buck Converter with Arduino

Hello friends,

I want to buy this CC CV Buck regulator to adjust the output voltage and output current in order to charge my Li-Ion Battery:
As you see, there are two potentiometers to adjust both current and voltage. Though, I would like to control it digitally via Arduino Pins.

On Arduino Forum I have already found an idea how to control the voltage with Arduino using PWM and a third resistor: (idea from user dc42).

But now is the question how to control the current digitally? Do you have any solutions for this? I have to mention, that I am not an electronic specialist and I don't know how to design circuits...But I hope, that some of you already faced that problem and found a good solution for it.

I will be very thankful for suggestions!

First off you can not control the voltage and the current from a regulator. What you have here is is a voltage control and a current limit control.

Next you can not just replace these post with a variable voltage from the PWM output, they are in a feedback loop.

Your only hope is to use a digital pot. The snag is that it must be able to withstand the voltages in the circuit and cope with the currents involved. Even then the resolution is likely to be too course for good control.

There are specialised chips for controlling battery charging, use them.

You should probably read this.