# PWM to DC

Hello, i have mega 2560. how do i convert the pwm signal to stright DC voltage?

Thank you

Hello, i have mega 2560. how do i convert the pwm signal to stright DC voltage?

Thank you

With a low-pass RC filter. 4.7k and caps from 0.1 to 1.0 seem to be common recommended values, but you can do the math out to figure out what's right for your application, based on your tolerance for ripple vs the timescale of changes.

Note that you cannot draw current from this - it's just a reference voltage. If you need non-negligible current, you'll need to buffer it with an opamp.

Please explain more of what you want to do with the voltage. It may determine how we advise on this question.

Weedpharma

maor444: Hello, i have mega 2560. how do i convert the pwm signal to stright DC voltage?

Thank you

You want it pretty ripple free, or 100% ripple free? I don't expect you can get to 100%. Maybe, 99 44/100 percent.

The output of a PWM signal at about 500 hz is pretty ripple free. If you need more, you can add RC or LC circuits.

As weedpharma asks, give us more detail of your requirement, and we can give more precise advice.

And don't double post!!

Weedpharma

I want to make srtight DC voltage and connect it to MKS 247D device. the DC voltage that i need is determined the amount of the gas flow in the MKS 247D. the MKS 247D controlls gases and i need to connect it to the Arduino with Shield circuit, so i need stright DC to supply the MKS 247D to determined the gas flow of the device.

I tried to connect RC circuit to the PWM but i had high jumps in the voltage. I need maximum jumps of 0.06V.

So you see a big jump from analogWrite(pinX, 0) to (pinX, 1) and (pinX, 2) for example?

If the levels were strictly linear from 0 to 255, the smallest, 1/255 of 5V, would yield 19.6mV/step, so a level of (pinX, 3) would be ~58.8mV. What are you seeing?

im not use this, im using LINX in LabVIEW. i see sine wave

and i want it will be stright not sine wave.

Can you use your Oscope to view the voltage from the PWM, with a LC circuit on it? What is the ripple?

You may need some other ckt to get a smooth ( 0.06v) or less, ripple. That is a really critical spec.

Even if the arduino PWM could give that much accuracy, you could lose it if you are using a breadboard with non-soldered wires. For that kind of accuracy, solder all wires that you can.

You may need a high precision (high cost) power supply for that much accuracy.

im not use this, im using LINX in LabVIEW.

Who knows then. I have no knowledge of LINX and LabVIEW.

Hi , Try this one , the schematic is verified and for your reference.