Continue to Site

# sine to square wave converter

Status
Not open for further replies.

#### yanivdan98

##### Newbie level 6
hi

i am trying to understand how to convert sine wave to square wave:

i found this over the internet:

however i didnt understand some points and i will be happy for explanations:

1. where is connect the second input of the operational amplifier? (i see that it has only one input, however as i know the operational amplifier has 2 inputs)

2. why do we need the capacitor?

thanks alot

That's not an opamp. If you read the text, it tells you it's a schmitt trigger, it said nothing about opamps.

You need to the capacitor so that the input to the schmitt trigger doesn't go below the negative rail.

yanivdan98

### yanivdan98

Points: 2
to get the square wave from sinusodial wave you can simply connect input waveform to two pins + and - of a comparator i.e. LM324

yanivdan98

### yanivdan98

Points: 2
as u can c, pin1 of the device is grounded. so when the voltage at pin3 is positive, the output goes to +Vsat; 'n when the voltage at pin3 is negative, the output goes to -Vsat. thus, the sine wave at the input is converted to a square wave at the output of the op-amp (oh yes, the schmitt trigger is an application of the op-amp).
hope this helped

yanivdan98

### yanivdan98

Points: 2
thanks you all my friends!

soi want to understand something..can i connect the capacitor derectly to op-amp that the second input to zero and then i will have a sine to square wave converter...

only to be sure..it right?

If you are going to use an opamp, you MIGHT want to add a little positive feedback to avoid oscillation. It may not be necessary depending on your application, your input an d your opamp.

@barry: did u mean 'negative feedback to avoid oscillations'? 'cause i believe positive feedback makes oscillations, rather than preventing them!

i think he meant 'hysteresis'.

In general, though you CAN use an opamp like a comparator, (and it often is) it is always better to use an IC which is designed to be a comparator. Like LM311 & similar.

@barry: did u mean 'negative feedback to avoid oscillations'? 'cause i believe positive feedback makes oscillations, rather than preventing them!

No, I meant POSITIVE feedback (or hysteresis, if you prefer). And, I agree with rohitkhanna that a comparator might be better; but in many applications an opamp will work just fine.

sorry but i lost u guys there..! can u please elaborate on how hysteresis can be reduced by positive feedback?

No no ... hysteresis in this application is a GOOD thing.

vishnu.mthss

Points: 2