biasing op-amp input

Thread Starter

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.

1.png

2.png
 

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?
 

Thread Starter

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.
 

Thread Starter

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
EG57_ 493.png
 

Thread Starter

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.
 

Thread Starter

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.
 

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.
 

Thread Starter

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,
1.png2.png
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:

Thread Starter

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:
1674748131956.png1674748149898.png

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

EDIT: Tektronix did it with a diff pair in FG502:
1674749277427.png
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.

Read the LM358 data sheet.

The common mode voltage range goes from the negative rail (which is 0 V in your case) to 2 V below the positive rail (which is 5 V in your case). So if either of your input signals is not between 0 V and 3 V, you cannot expect the opamp to function properly.
 
Top