I want to read the 14V PWM signal on Attiny85 running an Arduino IDE. It is a control signal sent from the car's PCM to the cooling fan. The frequency of thes signal is 120Hz while the duty cycle is changing from 0 to 100%. As I understand, I have two main options: 1) use a resistive voltage divider and a capacitor to form a low pass filter, and reading the signal as an analog voltage; 2) a resistive voltage divider and some sketch that will measure the duty cycle. Which solution is better? Regarding the RC filter, what must be the cutoff frequency? The speed of the response is not so important.
1 Answer
First of all, use a voltage divider to reduce the voltage to ATTINY supply voltage level, then use an RC filter to filter the noise coming from the signal.
In this you have two options, if noise is low then use a very low-value capacitor and if noise is high and contains voltage spikes then use a high-value capacitor.
In both, cases your cutoff frequency should be at least 100 times the signal frequency ie 12KHz or above to avoid signal distortion.