To make my problem easier to describe, I drew the above figures (abbreviated as Fig.).
The sinusoidal input comes from a rotating device, from a small alternator(a permanent magnet AC generator).
My aim is to convert these incoming sinusoidal inputs to pulses with nice sharp edges as in Fig. B. A DAQ hardware will read these pulses to obtain the frequencies...
As you see above, Fig. A is the input to the Schmitt trigger circuit(Fig. D). The input has some noise and its frequency varies between 4Hz up to 20Hz and its amplitude varies from 1V up to 12V. So the input will vary in this range and I want the circuit to work in any scenarios in this range.
My problem is my circuit works perfectly in simulation but fails in real life sometimes. Some outputs results as in Fig. C randomly. I do not remember if this was happening under particular inputs. But the frequency and the amplitude both increase with rotation speed of this alternator.
How can I fix this issue here? I asked a related question before but since I were not able to provide enough data I couldn't find a solution. The only suggestion was to choose C2 as 10uF and connect the negative end of this cap to the input signal, since according to the suggester the input was coming from an alternator.
If I use another Schimtt trigger as cascade at the output of this one the pulses becomes less noisy. But a pulse like in Fig. C looks very problematic. Is that because this circuit's upper and lower trigger limits are not arranged for the input range. I really need help at the moment and would be very glad for any adjustment suggestion in this circuit.