Go Down

Topic: PWM to DC (Read 2515 times) previous topic - next topic

maor444

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

Thank you

maor444

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

Thank you

DrAzzy

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.
ATTinyCore and megaTinyCore for all ATtiny, DxCore for DA/DB-series! github.com/SpenceKonde
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

weedpharma

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

Weedpharma

jack wp

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.

weedpharma

And don't double post!!

Weedpharma

Coding Badly


Do not cross-post.  Threads merged.


maor444

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.

maor444

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

CrossRoads

#9
Nov 17, 2015, 06:55 pm Last Edit: Nov 17, 2015, 06:56 pm by CrossRoads
So you see a big jump from analogWrite(pinX, 0) to (pinX, 1) and (pinX, 2) for example?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

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?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

maor444

#11
Nov 17, 2015, 07:02 pm Last Edit: Nov 17, 2015, 07:06 pm by maor444
im not use this, im using LINX in LabVIEW.
i see sine wave

maor444

and i want it will be stright not sine wave.

jack wp

#13
Nov 18, 2015, 01:42 am Last Edit: Nov 18, 2015, 02:03 am by jack wp
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.

Is your power supply even that accurate? How about your house voltage?

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




CrossRoads

Quote
im not use this, im using LINX in LabVIEW.
Who knows then. I have no knowledge of LINX and LabVIEW.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up