Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Op Amp Circuit for 2 square waves, 180 degrees out of phase

3 views
Skip to first unread message

Bruce

unread,
Aug 11, 2002, 2:08:17 PM8/11/02
to
Guys,

I'm using an LM324, single supply op amp to produce a nice square wave.
This is a typical circuit using a cap and a few resistors as described in
the data sheet. My only mod is using a 50k pot between the cap and ground
to adjust the frequency. This all works great. Here is the problem:

I need 2 squarewaves, 180 degrees out of phase. I'm looking to modify this
circuit and use another of the 4 op amps to produce the second square wave.
I'm not quite sure how to do this. I'm thinking I'll have to tie the other
op amp into the backside of the cap but I really need some help with this
one.

If this isn't possible or easy, I could use digital logic to take the one
square wave and output 2 square waves. Would this be a better solution.

Thanks,
Bruce

Ban

unread,
Aug 11, 2002, 3:17:03 PM8/11/02
to

"Bruce" <nu...@damn.business.com> schrieb im Newsbeitrag
news:3d56a6ec...@news.houston.sbcglobal.net...

Bruce nothing is simpler- you just need an inverter consisting of an opamp
and 2 resistors of equal value 10k is good. Feed the output of your
oscillator through one resistor to the inverting input, and the other
resistor between the output and the inverting input. the non-inverting input
is biased to a little less than the middle of the supply, which can be
paralleled with the other opamp's non-inverting input, or with a voltage
divider. voila
--
ciao Ban
electronic hardware designer
http://thinkamove.com/


John Woodgate

unread,
Aug 11, 2002, 2:28:13 PM8/11/02
to
I read in sci.electronics.design that Bruce <nu...@damn.business.com>
wrote (in <3d56a6ec...@news.houston.sbcglobal.net>) about 'Op Amp
Circuit for 2 square waves, 180 degrees out of phase', on Sun, 11 Aug
2002:

>I need 2 squarewaves, 180 degrees out of phase. I'm looking to modify this
>circuit and use another of the 4 op amps to produce the second square wave.
>I'm not quite sure how to do this.

Configure it as a unity-gain inverter (4k7 to inverting input, 4k7
feedback and non-inverting input grounded) and connect its input to the
output of your first stage.
--
Regards, John Woodgate, OOO - Own Opinions Only. http://www.jmwa.demon.co.uk
Interested in professional sound reinforcement and distribution? Then go to
http://www.isce.org.uk
PLEASE do NOT copy news posts to me by E-MAIL!

Bruce

unread,
Aug 11, 2002, 6:05:03 PM8/11/02
to
In sci.electronics.design
"Ban" <ban...@masterweb.it> wrote:

>Bruce nothing is simpler-

For you :) I'm a software guy.

>you just need an inverter consisting of an opamp
>and 2 resistors of equal value 10k is good.

Works like a charm, thank you.

Bruce

John Popelish

unread,
Aug 11, 2002, 6:12:36 PM8/11/02
to

If this circuit uses the opamp to swing from lock to lock (full supply
saturation, via positive feedback) then all you have to do is connect
a second set of opamp inputs in parallel with the first one, but with
the polarities reversed. No other components needed. This will make
sure that both outputs are saturated.

--
John Popelish

Bruce

unread,
Aug 11, 2002, 6:31:53 PM8/11/02
to
In sci.electronics.design
John Popelish <jpop...@rica.net> wrote:

>If this circuit uses the opamp to swing from lock to lock (full supply
>saturation, via positive feedback) then all you have to do is connect
>a second set of opamp inputs in parallel with the first one, but with
>the polarities reversed. No other components needed. This will make
>sure that both outputs are saturated.

John, I already wired it on my proto board like Ban suggested and it works
fine but the output of the second opamp is slightly lower. I believe your
solution will eliminate this problem. I'll give it a try.

Man, I feel ignorant after reading these responses. This solution seem so
simple now :)

Thanks,
Bruce

John Popelish

unread,
Aug 11, 2002, 10:08:52 PM8/11/02
to

After you have built many circuits and designed a few, you start to
think of opamps from the inside (what would I do in this situation if
I were an opamp?), and it gets a lot easier to imagine new ways to use
them.

--
John Popelish

Ban

unread,
Aug 12, 2002, 3:56:52 AM8/12/02
to

--
ciao Ban
electronic hardware designer
http://thinkamove.com/

"John Popelish" <jpop...@rica.net> schrieb im Newsbeitrag
news:3D57199D...@rica.net...

Well, both circuits have their pros and cons.
The problem with the higher 0-voltage on the inverted output will disappear,
when you choose the bias resistor from the non-inverting inputs to gnd a
little smaller, so there is only 2V bias instead of 2.5V (assuming you have
5V supply). This will have a couple of advantages:
1. The waveform will be more symmetric.
2. The output swing of both outputs will be more equal
The reason for this is, that a LM324 is not able to swing to the positive
rail, but nearly reaches the negative one. So the best would be if you
measure the high output of your opamp and choose a bias voltage half of it.
You could also use a 'rail-to-rail in/out opamp' and keep the circuit as it
is.

Now to Johns proposition: A very smart idea saving two resistors and having
full and equal output swing. But if the edges have to be synchronized you
should check the second channel on your scope if there is no delay of the
inverted signal, but I think with low frequencies clock this would not
matter much. The symmetry issue can be cured with the above described
method.

ciao Ban


Bruce

unread,
Aug 12, 2002, 9:49:28 AM8/12/02
to
In sci.electronics.design
"Ban" <ban...@masterweb.it> wrote:

>Now to Johns proposition: A very smart idea saving two resistors and having
>full and equal output swing. But if the edges have to be synchronized you
>should check the second channel on your scope if there is no delay of the
>inverted signal, but I think with low frequencies clock this would not
>matter much. The symmetry issue can be cured with the above described
>method.

Hi Ban

I'm bringing the circuit to work this morning to check them both out on a
scope. My frequencies are VERY low from 10 Hz to 0.3 Hz.

Thanks to both for your input.

Bruce

Bob Wilson

unread,
Aug 12, 2002, 11:16:44 PM8/12/02
to
In article <3d56a6ec...@news.houston.sbcglobal.net>,
nu...@damn.business.com says...

An LM342 is far too slow to produce a "nice" squarewave. It produces a
squarewave with somewhat rounded "corners". Anyway, I am wondering why you
need 4 opamps to produce a squarewave, when a single one will do the job
quite nicely? You need one opamp, one cap and a couple of resistors.

Then another opamp, operating as a standard inverter stage will invert the
first squarewave and give you your 180° phase shift. For this, you need only
an opamp, and no other parts. This meands that you can throw out the LM324
quad opamp, and use an LM358 dual opamp (same actual opamps, but smaller
package).

As a general statment, from your description of what you seem to think you
need to do, I suggest actually doing a little reading on opamp basics. Start
by looking at the LM324/LM358 data sheet, which has numerous example
circuts attached.

Bob.

Bruce

unread,
Aug 13, 2002, 1:16:40 AM8/13/02
to
In sci.electronics.design
rfwi...@intergate.nospam.bc.ca (Bob Wilson) wrote:

>An LM342 is far too slow to produce a "nice" squarewave.

First rule of engineering is to define the problem Bob. My frequency is
measured in fractions of Hz. It will produce a "very nice" squarewave at
those frequencies.

> Anyway, I am wondering why you need 4 opamps to produce a squarewave,
> when a single one will do the job quite nicely?

Well, it was what I had in the parts bin. Would you use that or drive 20
miles to the parts house?

>As a general statment, from your description of what you seem to think you
>need to do, I suggest actually doing a little reading on opamp basics.

I'm working on it Bob. Your condescending tone isn't helping. I learn
best by doing.

>Start by looking at the LM324/LM358 data sheet, which has numerous example
>circuts attached.

Been there, done that. That is how I built the original signal generator.
The data sheet does not tell how to make two of them 180 degrees phase
shifted.

Thanks anyway,
Bruce

Fred Bloggs

unread,
Aug 13, 2002, 9:52:51 AM8/13/02
to

Bruce wrote:

>
> I'm using an LM324, single supply op amp to produce a nice square wave.
> This is a typical circuit using a cap and a few resistors as described in
> the data sheet. My only mod is using a 50k pot between the cap and ground
> to adjust the frequency. This all works great.

Are you referring to the square wave oscillator application circuit with
timing capacitor between in(-) and GND joined to a feedback resistor
from the output? If so, then you must have changed the resistor values
to be using a 50k pot, and paralleling the capacitor with a pot is not a
good way to go because of the exponential non-linearity of the charging.
You would be better off using the pot as the feedback resistor. This way
the output period will be directly proportional to the pot setting, and
it remains at 50% duty cycle for all pot settings, maintaining the
capacitor charging/discharging between symmetric limits of Vcc/3 and
2Vcc/3. You should series the pot with a fixed resistor to limit your
output period to a minimum value. As others have stated, the inverted
waveform is most easily produced by paralleling the controlling
amplifier with a second using reversed inputs. Like so:

View in a fixed-width font such as Courier.


_
RMIN /|
+----/\/\---/\/\----+ T=1.4(Rmin+Rpot)CT
| / POT | |
| | | | |
| |\ | ->| |<----+
| | \ | | |
+--------+----------|- \ | + +---+ +---+
| CT| | \ | | | | | |
| --+-- | \ | | | | | |
| --+-- | ---+-> +---+ +---+ +---
| | | / |
| | R | / | | |
| GND--+-/\/\-+---|+ / | | |
| | | / | | |
| | |/ | | |
| | | | |
| | | | |
| R | R | | |
| VCC -/\/\---+----/\/\----+ | |
| | | |
| | | |
| | |\ | |
| | | \ | |
| +---|- \
| | \ +---+ +---+ +---
| | \ | | | | |
| | -----> | | | | |
| | / + +---+ +---+
| | /
+-------------------|+ /
| /
|/

Fred Bloggs

unread,
Aug 13, 2002, 10:08:07 AM8/13/02
to

Fred Bloggs wrote:

Actually, because your timing period is so large, that first approach
could result in a fairly large skew dependent on frequency and amplifier
offset mismatch. Here is a way to reduce the skew to that of the opamp
slewing time divided by 6, and this will be independent of frequency.

Please view in a fixed-width font such as Courier.


_
RMIN /|
+-----/\/\---/\/\----+ T=1.4(Rmin+Rpot)CT
| / POT | |
| | | | |
| |\ | ->| |<----+
| | \ | | |
+-----------|- \ | + +---+ +---+


CT| | \ | | | | | |
--+-- | \ | | | | | |
--+-- | ---+-> +---+ +---+ +---
| | / |
| R | / | | |

GND---+--/\/\-+---|+ / | | |
| | / | | |
| |/ | | |
| | | |
| | | |
R | R | | |
VCC --+--/\/\-+----/\/\----+ | |
| | | |
| | | |
| | |\ | |
| | | \ | |
\R +---|- \
/ | \ +---+ +---+ +---
\ | \ | | | | |
/ | -----> | | | | |


| | / + +---+ +---+
| | /

+-----------|+ /
| | /
\R |/
/
\
/
|
GND

John Popelish

unread,
Aug 13, 2002, 11:53:09 AM8/13/02
to
Fred Bloggs wrote:

This is an excellent improvement on my suggestion.
--
John Popelish

Rich Grise

unread,
Aug 13, 2002, 4:13:26 PM8/13/02
to
John Popelish <jpop...@rica.net> wrote in message news:<3D57199D...@rica.net>...
> Bruce wrote:
> >
...

> > Man, I feel ignorant after reading these responses. This solution seem so
> > simple now :)
> >
> > Thanks,
> > Bruce
>
> After you have built many circuits and designed a few, you start to
> think of opamps from the inside (what would I do in this situation if
> I were an opamp?), and it gets a lot easier to imagine new ways to use
> them.

I had an opamp epiphany of sorts (no, not a Speffany ;-} ) when
I read "The opamp does at its output whatever it needs to
do to make the inputs equal."

Bruce, we all started out ignorant, which after all, merely
means, "I do not know."

Have fun, and welcome to the club!
Cheers!
Rich

Spehro Pefhany

unread,
Aug 13, 2002, 4:18:48 PM8/13/02
to
The renowned Rich Grise <richar...@yahoo.com> wrote:

> I had an opamp epiphany of sorts (no, not a Speffany ;-} ) when

<cough> They do have the same root, or so I'm told. ;-)

> I read "The opamp does at its output whatever it needs to
> do to make the inputs equal."

Works until you accidentally reverse the inverting and non-inverting
inputs, then you realize the op-amp isn't so clever after all.

Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
9-11 United we Stand

0 new messages