This circuit was designed to convert a low amplitude 40KHz signal into a clean square wave signal. It will work with inputs as small as 5mv peak-to-peak or as large as 3 volts peak to peak. The input frequency can range from a few kilohertz to about 150
http://www.discovercircuits.com/PDF-FILES/zerocross1.pdf