1
\$\begingroup\$

I'm trying to build a Linear bench PSU, Here's what I did so far:

schematic

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.

\$\endgroup\$
  • \$\begingroup\$ I did tried to increase the opamp gain but again it's not accurate at all. That's because the transfer of the MOSFET's Vgs to Id (drain current) is highly unpredictable. You make an accurate voltage at the output of the opamp. Then feed it to a highly inaccurate MOSFET. This is never going to work! You should study existing designs to learn how this is done. It is unclear to me what you're trying to achieve with the MOSFET. \$\endgroup\$ – Bimpelrekkie Oct 8 at 9:16
  • 1
    \$\begingroup\$ @Bimpelrekkie i'm trying to vary the output voltage! you mean i need to use another mosfet? can you please provide a link to an article which explains such a design? all designs i could find are analog and i couldn't find any which control the voltage digitally.. \$\endgroup\$ – Hamed Oct 8 at 9:25
  • 1
    \$\begingroup\$ Possible duplicate of Op amp voltage regulator using N-Mosfet \$\endgroup\$ – Huisman Oct 8 at 9:30
  • 1
    \$\begingroup\$ you mean i need to use another mosfet? No, I mean understand why this circuit doesn't work and then thinking about how it can be made to work. If you're not a circuit designer then learn how other designers to this. Study schematics and figure out how they work. Just randomly adding transistors will get you frustrated and give up. \$\endgroup\$ – Bimpelrekkie Oct 8 at 9:30
  • 1
    \$\begingroup\$ Upvoted (despite possible duplicate) because found and used the schematic editor. \$\endgroup\$ – MarkU Oct 8 at 19:55
6
\$\begingroup\$

To make a crude "lab supply" you might have more luck with a schematic like this:

schematic

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.

\$\endgroup\$
  • \$\begingroup\$ I don't think my answer adds much to this. Upvoted and delete mine. \$\endgroup\$ – Spehro Pefhany Oct 8 at 9:40
  • 1
    \$\begingroup\$ Yes, the key difference with this solution is that the FET is enclosed within the feedback loop, so the op amp automatically corrects for its nonlinear and temperature dependent characteristics. The circuit in the question did have feedback, but it only controlled the gate of the FET, not its output; maybe it could have worked if there was a way for the Arduino to measure and correct the error... but this circuit is better because it does not depend on firmware to correct the errors. Do note that the op amp should have bypass capacitors across its power pins, not shown but implied. \$\endgroup\$ – MarkU Oct 8 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.