Is it possible for an arduino to read a PWM signal through an analog in pin?
I have one arduino that reads some force sensing resistors and then outputs a PWM signal which then goes into another arduino through the analog in. The problem I am having is that the analog in seems to read the highs and lows from the PWM. Is there anyway to make this PWM read like an actual analog input?
Thanks for your help,
Put the signal through a low pass filter, 1K resistor from output to input and 10uF or so to ground on the analogue input side.
I tried that and it doesn't seem to effect it. I have since increased the speed of the PWM and it seems to be working. I will try it in its final location and see what happens.
Thanks for your suggestion.
If the PWM speed improves it so will upping the value of the capacitor.
I'll give that a shot. Is there an equation to figure out the required capacitance and resistance for the filter?
Is there an equation to figure out the required capacitance and resistance for the filter
Yes but you need to know how much you want to smooth it and what frequency you are feeding it.
Best try a bigger capacitor. ;)
Or a Frequency to Voltage converter like the LM2917. I've used them with great success.
Those are even in their sample program so it is no cost to you for up to 5 of them(just make sure you select DIP or SOIC correctly).
How did you increase the speed of the PWM?