I assembled a circuit to convert a PWM signal generated by an Arduino to a DC voltage in the range 0..10 V. PWM to DC voltage converter

I use the 10k-10u RC filter to convert the PWM signal to DC voltage in the range 0..5 V, then the single-supply op amp in non-inverting configuration to amplify it to the range 0..10 V. I adjust the virtual ground and the gain with two trimmer potentiometers.

The circuit is almost working, but it is producing a strange error: the output voltage is rising slowly but steadily (if it is not too close to 0 V). I have included the 100k resistor to provide a path for the bias current, but it had no use...

Any help on how to solve the problem would be appreciated.

  • \$\begingroup\$ if the output from arduino is not push-pull, then your LPF has two constants, one for charging, the other for discharging capacitor (10k vs 100k). \$\endgroup\$ Apr 19, 2016 at 18:24
  • \$\begingroup\$ What time period did you simulate? Your input RC filter has a time constant of 100 ms. If you simulated for less than a couple of seconds, a slow rise or fall toward the eventual average value is exactly what you'd expect to see. \$\endgroup\$
    – The Photon
    Apr 19, 2016 at 19:22
  • \$\begingroup\$ It's the potentiometer that slowly changes the gain. Just connect the 10k to GND. \$\endgroup\$
    – user76844
    Apr 19, 2016 at 19:36
  • \$\begingroup\$ @MarkoBuršič I did not use the 100k originally, and the problem mentioned was already there. I only added the 100k to solve the problem (I thought that the bias current is charging the capacitor), but unfortunately it did not help. \$\endgroup\$
    – Andrew
    Apr 19, 2016 at 20:16
  • \$\begingroup\$ @ThePhoton I did not do any simulation, I have built the circuit. Yes, I set is to 100 ms intentionally. The rate of the 'slow and steady' rise of the output voltage is, say, 10 mV/s, and it happens after the desired DC voltage is set. \$\endgroup\$
    – Andrew
    Apr 19, 2016 at 20:21

1 Answer 1


Just tie the bottom end of the 10k resistor (on the inverting input) to 0V and see what happens - it should work just fine like this. Trying to create an offset with the two 1k resistors is missing the point of what this circuit is intended to do.

Also, you might struggle to get all the way up to +10V on the output with only a +12V supply.

  • \$\begingroup\$ I thought that I have to create a virtual ground (potential: 2.5V) in this case (single supply op amp). The DC potential on the non-inverting input is 0..5 V (this is the smoothed PWM signal). Then, the op amp 'subtracts' the potential of the virtual ground (2.5V) from the smoothed PWM signal (so it is -2.5V..2.5V), 'multiplies' it with the gain (so it is, say, -5V..5V), and then this is added to half the supply voltage (12V/2=6 V), so on the output it is 1V..11V. What am I missing? Yes the op amp is not rail to rail, but I can increase the supply voltage, that is not a problem. \$\endgroup\$
    – Andrew
    Apr 19, 2016 at 20:29
  • \$\begingroup\$ Thank you, Andy, I realized you're right (see my comment to the original question), I will modify the circuit and see what happens. \$\endgroup\$
    – Andrew
    Apr 19, 2016 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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