You might need to apply hysterisishysteresis to OA2 - this has the effect of minimizing the effect of noise as the signal from OA1 gets close to the threshold point defined by R7. Try a 1k ohm in series with the signal from OA1 to invertingnon-inverting input of OA2 and something like a 100k to 1M ohm from output of OA2 back to its non-inverting input. The size of this feedback resistor will set the amount of hysteresis.
Michael Karas
- 57.9k
- 3
- 74
- 139