How to convert PWM to analogic signal?

Hi all...

I have here a device made from an arduino board with some pot inputs but now I would like to use a RC receiver to control these pot inputs. The problem is that I don't have the arduino code and I don't know who has it in order to change the pot inputs to pwm inputs.

I have tried everything but I am not able to get a clean signal when I try to convert a pulse signal into a clean scale of 0v to 5v which is the pot signal.

I have tried to use another arduino to do it + some simple converters that I have found on the net using capacitors and resistor to filter the signal but no luck.... the signal is still like a step...

Does somebody knows an efficient way to do it?

Thank you in advance.

Kind regards

Maybe a digital POT or a DAC?

I have tried to use another arduino to do it + some simple converters that I have found on the net using capacitors and resistor to filter the signal but no luck.... the signal is still like a step...

Try a bigger capacitor and/or a bigger resistor. The [u]RC Time Constant[/u] is calculated simply as R x C. So for example, 1uF and 1 Megohm creates a time constant of 1 second. And, a 1 second time constant is probably close to what you want to follow a pot (which doesn't change very quickly).

The load resistance is part of the "R" too... i.e. If you connect an LED, the capacitor will discharge rather quickly through the low resistance. If the filter is to work "as calculated", the load resistance should he high compared to the resistor in the RC filter. (So, you might need a smaller resistor and a bigger capacitor, etc.)

(PWM is NOT the best way to make a digital-to-analog converter, but if you want to avoid the cost & trouble of adding a true DAC, you MAY be able to get acceptable results with PWM.)

pulseIn() is the usual function used to read RC servo signals. No need to convert, you just want to read it.