Electronic – Conditioning current pulse signals

currentpulsepwm

enter image description here

There is an instrument outputting pwm-like current pulse trains proportional to its rotation speed. I convert the output current pulses to voltage pulses by a shunt resistor to be read by a DAQ hardware. Pulses are sampled with 12kHz. The software detects the rising edges and calculates the frequency for each pulse.
Above on the left figure is what I see from the output of the instrument. P is the period, T is the pulse duration. Whatever the rotational speed the pulse duration T remains the same around 80us-120us(between 80 and 120 microseconds). Period P can be between 330us up to 2000us.

I have two questions:

1- As shown in the right side of the above figure, I want to convert these pwm-like pulses to sharper ones. What kind of op-amp configuration would you suggest for this application.

2- Since the frequency is counted between the rising edges what should be the sampling rate? My guess is 2*(1000000/80) = 25kHz. Would you agree?

3- If I cannot reach up to that sampling rate is there work around for lower sampling rates?

Best Answer

To add to Rodions answer, here is a circuit that uses a comparator instead of an opamp. It's built around the very cheap and popular LM311:

enter image description here

R1 and R2 form a voltage divider which set the threshold voltage.

R5 gives a bit of hysteresis by providing positive feedback. That makes sure that even if there is a bit of noise riding on your input signal you'll get clean rising and falling edges.

V+ is your supply voltage. Can be anything between 5V and 15V. Vio is the voltage expected at your DAQ hardware or micro-controller. Can by anything between 3V and Vio.

This circuit is good enough for frequencies up to 500khz or so.