# biasing op-amp input

#### cktboy

Joined Apr 24, 2020
45
i have a square wave signal from 555 timer which is connected to the inverting of LM358 op-amp. The square wave input is 0 to 5V peak to peak with 2.5V at the center. How can i make the signal to have center at 0V? like the sine wave which is connected to the non-inverting input as shown.

#### dl324

Joined Mar 30, 2015
17,142
Using an opamp as a comparator is generally a bad idea. The timer output will likely violate the common mode input voltage range of the opamp. The output from LM358 will experience inversion if that occurs.
1. What is the voltage swing of the AC source?
2. What output voltage swing do you require?
What is it that you're trying to do?

#### cktboy

Joined Apr 24, 2020
45
the graph shows the sine wave and the square wave from 555 timer. like sine wave i want to align the square wave to have its center at 0. I am trying to get output which compares square wave with a sine wave.

#### MrChips

Joined Oct 2, 2009
31,088
Use an op-amp summing amplifier and add the desired DC offset.

#### cktboy

Joined Apr 24, 2020
45
Use an op-amp summing amplifier and add the desired DC offset.
i am trying to compare the sine wave and square wave and want to use comparator, just need to know how to make the square wave center at 0 in the above circuit diagram.

#### ericgibbs

Joined Jan 29, 2010
19,120
Hi cktboy,
This is your circuit in LTSpice.
Have considered the effect of feeding the inputs of a LM358 with those voltage levels.?

Are you asking for guidance on how to make the Vout signal swing high/low 2.5V about a DC level of 2.5Vdc
E

#### cktboy

Joined Apr 24, 2020
45
Hi cktboy,
This is your circuit in LTSpice.
Have considered the effect of feeding the inputs of a LM358 with those voltage levels.?

Are you asking for guidance on how to make the Vout signal swing high/low 2.5V about a DC level of 2.5Vdc
E
View attachment 285996
hi, i want the square wave centered at 0V. In your waveform graph the square wave is centered at 2.5V, i want this signal centered at 0V. I want the inverting input (labeled 01 in your diagram) which is the square wave to be centered. I am not asking the output from op-amp Vout to be centered. I think the question is clearly stated. I added a coupling capacitor at the 555 timer output but it did not help.

#### ericgibbs

Joined Jan 29, 2010
19,120
Is this what you are asking for, if not, post a drawing showing what you mean.

#### MrChips

Joined Oct 2, 2009
31,088
Why are you comparing a sine wave and square wave with an analog comparator?
What do you hope to achieve?

#### cktboy

Joined Apr 24, 2020
45
Is this what you are asking for, if not, post a drawing showing what you mean.
View attachment 286001
hi, your solution works only initially for few 100us, after that the signal goes back to the original output with center around 2.3V or so.

#### ericgibbs

Joined Jan 29, 2010
19,120

#### cktboy

Joined Apr 24, 2020
45
Why are you comparing a sine wave and square wave with an analog comparator?
What do you hope to achieve?
that is what i want to know, what happens when we compare sine wave with square wave with a comparator and what the output looks like.

#### cktboy

Joined Apr 24, 2020
45

#### MrChips

Joined Oct 2, 2009
31,088
that is what i want to know, what happens when we compare sine wave with square wave with a comparator and what the output looks like.
You get nonsensical result. The output of a comparator is digital, zeros and ones.
Let us say the square wave is -1V to 1V.

While the square wave is at -1V and the sine wave is below -1V, the comparator output is 0.
When the sine wave is above -1V, the output is 1.

While the square wave is at 1V and the sine wave is below 1V, the comparator output is 0.
When the sine wave is above 1V, the output is 1.

#### cktboy

Joined Apr 24, 2020
45
i just wanted to know how to make the square wave centered at 0 in the same circuit, I want to see the nonsensical result from the circuit not somebody experience, i have also read about the expected output but i want to see the result myself,
it difficult to communicate these days.
Look below it is not difficult to see what the output is,

But the question is not what the output is, but how to make the square wave output from the 555 timer centered at 0V. I feel like my question is highjacked to some other topic now. Like I ask question relating to apple but get comments on banana.

Last edited:

#### MrChips

Joined Oct 2, 2009
31,088
See posts #4 and #8.
#8 makes the average DC voltage 0V. The DC offset changes with duty cycle.

#### ericgibbs

Joined Jan 29, 2010
19,120
Hi cktboy.

It is always difficult to give a meaningful reply to a badly worded question.

What is the purpose of this circuit.?
E

#### Attachments

• 58.8 KB Views: 8

#### cktboy

Joined Apr 24, 2020
45
Hi cktboy.

It is always difficult to give a meaningful reply to a badly worded question.

What is the purpose of this circuit.?
E
i don't know what wrong with my question and words, frankly speaking i think everybody reading this can understand the question, i am not able to write in special words for you, but i think its not your lack of understanding my words but rather childish act of insisting and i don't know why because your answer above shows you exactly know what my question is.

again, i want to center the square wave at 0, forget about purpose, i am not interested in the purpose(but if you insist assume i want high and low or whatever you wish to think), if i wanted to know about the output, i would have asked and frankly speaking i would not ask about the simple output in forum.

forget about frequency, forget about supply voltage, forget about which wire i am using, forget about source of sine wave, forget about op-amp, forget about everything unless they relate to centering the square wave output from the timer.

#### dl324

Joined Mar 30, 2015
17,142
i want to center the square wave at 0, forget about purpose
You could put the square wave through a summing opamp and use the other input to apply a DC offset to the square wave.

From National Semiconductor:

You're going to need a fast opamp to prevent degraded edges.

EDIT: Tektronix did it with a diff pair in FG502:

They used an RC network (R480/C480) to compensate square waves.

Last edited:

#### WBahn

Joined Mar 31, 2012
30,303
There are several ways to get your square wave to have a center of 0 V. But doing so will only add to your problems since your LM358 can't handle negative inputs.