Electronic – Need additional capacitor for comparator

comparator

I am designing a circuit for interfacing the frequency input signal.
I used simple Op amp inverting comparator with hysteresis, as below

enter image description here

The op amp is single powered by GND and 5V.
Otherthan decoupling capacitor for the supply pin, is it necessary to add additional capacitors for signal conditioning?

Best Answer

An LM358 will function fine in this circuit, however the output rise and fall times will be limited by the slew rate of the op-amp, typical more than 15usec. That will limit the frequency response, and not all counters will be happy with such long rise and fall times in a clock input. For example, the 74HC4040 specified maximum is 139ns/volt, which is way (more than 20x) faster than the 0.3V/us typical slew rate of an LM358. It could be cleaned up with a Schmitt trigger gate if required, however frequency response is unlikely to be more than a few 10s of kHz.

Further limiting the input frequency response with an RC on the non-inverting input could be desirable in some cases (maybe ~10kHz or less cutoff). The reason for considering this is that the positive feedback is delayed by the glacial slew rate of the output, and in the meantime the comparator is vulnerable to fast variations in the input. Here is the response near switching of the comparator with about 0.23V of hysteresis, a slow input ramp with a 10kHz 0.2Vp-p square wave superimposed:

enter image description here

And the same with a 10K/1nF filter ahead of the comparator (16kHz cutoff).

enter image description here

As Nick Johnson says, an op-amp as a comparator is sometimes possible (some op-amps are even worse suited) but usually not desirable except in very special circumstance such as where precision is more important than speed.

Op-amps have front ends that may be ill-suited for large differential voltages (the LM358 is okay), and most are internally compensated for stability at unity gain so they behave quite sluggishly. In the old days we would sometimes use uncompensated op-amps as comparators, but there are much better parts available these days.