I'm trying to build a Linear bench PSU, Here's what I did so far:
simulate this circuit – Schematic created using CircuitLab
So I'm converting the PWM to voltage using a low pass filter and opamp, but the mosfet gate threshold is 1V that means I can't have precise control over the output voltage. I did tried to increase the opamp gain but again it's not accurate at all.
How can I control the output voltage only with Arduino PWM (digitally)?
Without using a potentiometer to change opamp gain.
This question is not a duplicate, because in other questions they didn't specify that their output is controlled digitally.
Best Answer
To make a crude "lab supply" you might have more luck with a schematic like this:
simulate this circuit – Schematic created using CircuitLab
Do note that this simple circuit has limitations. The LM358 cannot drive it's output to 12 V, it can do up to about 8 V. Then there's the Vt of the MOSFET meaning that Vout can go up to around 6 V or so.
Since the feedback divider circuit (R3, R4) sets a gain of 2, for 6 V at the output you will need an average PWM voltage of 3 V.