How to change sine wave into square wave with voltage comparator
Find an operational amplifier whose positive terminal is connected to a sine wave signal and its negative terminal is connected to a voltage regulator. When the positive terminal signal voltage value is greater than the negative terminal reference voltage value, the output of the operational amplifier is the maximum; When the positive signal voltage value is less than the reference voltage value, the output of the operational amplifier is the minimum value, and the maximum and minimum values of the output of the operational amplifier are the positive and negative power supply values. If you think the output square wave signal is too large, adding a limiter at the back can control the amplitude of the output signal.