If you use op amps such as LM358 and LM324 for shaping. It is not surprising that this phenomenon occurs. The output swing of this type of device cannot meet the needs of microcontroller logic (TTL) levels. In addition to the phenomenon you mentioned, it will also cause the microcontroller interrupt to be unable to be effectively triggered. But if LM393 or CMOS op amp is used for shaping, this phenomenon will not occur.