# Convert sine to square

#### elec_eng

Joined Mar 22, 2007
2
Hi.

What type of circuit could i use to convert a sine wave to a square wave. The resulting square wave would need to have the same frequency and amplitude of the sine wave. The sine wave would be working in the range of 0-10kHz and 0-2 V p-p. Could this be done using a 741 op-amp?

Thanks.

#### thingmaker3

Joined May 16, 2005
5,083
You can configure the 741 as a comparator, with one of the inputs about halfway between the peaks of the sine wave.

#### Dave

Joined Nov 17, 2003
6,969
Hi.

What type of circuit could i use to convert a sine wave to a square wave. The resulting square wave would need to have the same frequency and amplitude of the sine wave. The sine wave would be working in the range of 0-10kHz and 0-2 V p-p. Could this be done using a 741 op-amp?

Thanks.
You may find Volume 3 - Chapter 8.3 of help.

Dave

#### Ron H

Joined Apr 14, 2005
7,063
It's going to take something much more complex than a comparator to perform the "same amplitude" function, especially at zero Hz (impossible). Can you give a more acceptable low-frequency limit, like maybe 20Hz?

#### thingmaker3

Joined May 16, 2005
5,083
I missed the "same amplitude" clause of the sentence. Ron is correct - an attenuator stage of some kind, or maybee a VCA, will need to follow the comparator. Not sure off the top of my head how to make such a thing work.

Another method might be to take the comparator's rails from a slightly amplified, rectified, & filtered version of the i/p. Won't be much good at lower frequencies, though.

#### Ron H

Joined Apr 14, 2005
7,063
I missed the "same amplitude" clause of the sentence. Ron is correct - an attenuator stage of some kind, or maybee a VCA, will need to follow the comparator. Not sure off the top of my head how to make such a thing work.

Another method might be to take the comparator's rails from a slightly amplified, rectified, & filtered version of the i/p. Won't be much good at lower frequencies, though.
Assuming some reasonable minimum frequency, I would make positive and negative peak detectors (rectifiers), and a comparator which controls analog switches from those voltages to the output.

Something like this. If you wanted it to respond rapidly to amplitude changes, the peak detectors would have to be sexier, maybe with some sample-and-holds.

#### Attachments

• 20 KB Views: 168