Electrical – PWM to DC converter with op amp – slowly but steadily rising output voltage

arduinooperational-amplifierpwmsingle-supply-op-amp

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.

Best Answer

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.