I have a simple pre-made buck converter that looks something like this:
The output voltage can be easily adjusted, by turning the R2 trimpot, which adjusts the voltage the feedback pin is getting.
What I would like to do, is to take this mechanical way of setting the output voltage and change it to a digital one, where I can set the output voltage I want with something like an Arduino.
My first idea was to simply rip out the R2 trimpot and replace it with a digital potentiometer, but this turned out to be a no-go, since the digital pots I have (and most cheap digi pots I have seen) have voltage limits of around 0 - 5V, and I will be outputting voltages between 1.2 - 23V (The power source feeding the buck is 24V)
My second idea would be to somehow use an op amp to replace the R2 trimpot, but I have not been able to figure out how to go about this.
What would be some simple way to achieve my goal?