I need to convert the duty cycle 250Hz (5% to 95% ) into analog voltage from external sensor (PWM sensor with low side output). See attached circuit . I use 74HC14 logic to have duty cycle in logic supply voltage range and the 2nd order low pass filter to get analog voltage for ADC.

The issue is that step respond of this filter is 0-95% -> 65ms 0->99% 130ms. In addition I have the ripple voltage of ~50mV (~ 1% of duty cycle)

DO you have any idea how to have the faster step respond and lower ripple voltage? I would like to make it as simple as possible.

In addition, I am thinking about software filter. Do you have any examples of filter which I could use to have faster step respond and reduce ripple voltage ?

What would be the middle point between filter parameters and software filtering capability for such signal to get decent accuracy /fast respond?


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ If your PWM frequency is 250 Hz, then your step response is necessarily going to be > ~4ms. Otherwise you're going to get a LOT of ripple. A 65 us step response is good for a ~15 kHz PWM signal. Besides, at 250 Hz, you can't get updates faster than every 4ms. \$\endgroup\$ – alex.forencich Dec 20 '14 at 10:19
  • \$\begingroup\$ Yep. I made mistake it is not 65us but 65 ms. I just changed it. \$\endgroup\$ – doodgraver Dec 20 '14 at 13:51

The lazy Engineer's answer is to drop in an LTC2645 which will directly perform the required task with the absolute minimum latency.

enter image description here

Or roll your own using any micro with a hardware capture peripheral and a DAC (internal or external).


Use a micro and a fast clock. Count the number of pulses in one full cycle and the number of pulses when the signal is high. Do some math and you get a result every cycle.

  • \$\begingroup\$ I am going to do that with capture compare unit. In parallel to that I need the second method of duty cycle detection. \$\endgroup\$ – doodgraver Dec 20 '14 at 13:54
  • \$\begingroup\$ Why do it with two different methods. The pulse count method is going to be superior to any other method providing your high frequency clock is high enough to give you the resolution. \$\endgroup\$ – Andy aka Dec 20 '14 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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