0
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ Duty cycle. An RC filter can either smooth the PWM signal accurately, or respond reasonably fast to throttle input, but not both. \$\endgroup\$
    – user16324
    Commented Oct 3, 2020 at 11:42

1 Answer 1

1
\$\begingroup\$

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. enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.