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

Switchable inverting/non-inverting opamp circuit?

469 views
Skip to first unread message

Richard Rasker

unread,
Jul 26, 2011, 2:06:14 PM7/26/11
to
Hello,

I recall having seen a rather simple circuit with 2 opamps (IIRC) which
could switch from inverting to non-inverting operation by means of
switching a single transistor or FET on and off -- but I can't find it
anywhere anymore.

For a particular type of ramp generator, I need to switch electronically
between two voltages, mirrored around a reference voltage of 1.25V -- e.g.
1.0V and 1.5V, or 0.7V and 1.8V etcetera.

Sure, I can build a simple opamp inverter with 1.25V at its + input, and use
a 4053 two-channel multiplexer gate to switch between the input and output
voltages, but that seems like a bit of waste in terms of devices and PCB
space.

Can anyone remember how this was done? Thanks already for any suggestions.

Richard Rasker
--
http://www.linetec.nl

John Larkin

unread,
Jul 26, 2011, 2:53:46 PM7/26/11
to


ftp://jjlarkin.lmi.net/Gain_PM1.JPG

or

ftp://jjlarkin.lmi.net/Gain_PM1_b.JPG


But the circuit you suggest, the inverter and the downstream mux, are
about equivalent. This does have a lower output impedance in both
states.

John

Richard Rasker

unread,
Jul 26, 2011, 3:31:18 PM7/26/11
to
John Larkin wrote:

> On Tue, 26 Jul 2011 20:06:14 +0200, Richard Rasker
> <spam...@linetec.nl> wrote:
>
>>Hello,
>>
>>I recall having seen a rather simple circuit with 2 opamps (IIRC) which
>>could switch from inverting to non-inverting operation by means of
>>switching a single transistor or FET on and off -- but I can't find it
>>anywhere anymore.
>>
>>For a particular type of ramp generator, I need to switch electronically
>>between two voltages, mirrored around a reference voltage of 1.25V -- e.g.
>>1.0V and 1.5V, or 0.7V and 1.8V etcetera.
>>
>>Sure, I can build a simple opamp inverter with 1.25V at its + input, and
>>use a 4053 two-channel multiplexer gate to switch between the input and
>>output voltages, but that seems like a bit of waste in terms of devices
>>and PCB space.
>>
>>Can anyone remember how this was done? Thanks already for any suggestions.
>>
>>Richard Rasker
>
>
> ftp://jjlarkin.lmi.net/Gain_PM1.JPG

Yup, that was the one I meant -- so simple it's almost alarming that I
couldn't remember. I must be getting old :-/
I can replace the switch with a small-signal MOSFET, and have the exact
desired solution -- a few thents of an ohm Rdson are no problem with R=10K.

> or
>
> ftp://jjlarkin.lmi.net/Gain_PM1_b.JPG
>
>
> But the circuit you suggest, the inverter and the downstream mux, are
> about equivalent. This does have a lower output impedance in both
> states.

Indeed it does -- but I think I'll just go with the first solution.

Anyway, thanks so much, now I can get on with the really tricky bits :-)

Fred Bloggs

unread,
Jul 26, 2011, 3:42:25 PM7/26/11
to

Sounds like you're talking about the circuit on PDF file page 13 ,
Voltage Controlled Oscillator Circuit, at http://www.national.com/ds/LM/LM124.pdf
....

John Larkin

unread,
Jul 26, 2011, 3:58:47 PM7/26/11
to
On Tue, 26 Jul 2011 21:31:18 +0200, Richard Rasker
<spam...@linetec.nl> wrote:

>John Larkin wrote:
>
>> On Tue, 26 Jul 2011 20:06:14 +0200, Richard Rasker
>> <spam...@linetec.nl> wrote:
>>
>>>Hello,
>>>
>>>I recall having seen a rather simple circuit with 2 opamps (IIRC) which
>>>could switch from inverting to non-inverting operation by means of
>>>switching a single transistor or FET on and off -- but I can't find it
>>>anywhere anymore.
>>>
>>>For a particular type of ramp generator, I need to switch electronically
>>>between two voltages, mirrored around a reference voltage of 1.25V -- e.g.
>>>1.0V and 1.5V, or 0.7V and 1.8V etcetera.
>>>
>>>Sure, I can build a simple opamp inverter with 1.25V at its + input, and
>>>use a 4053 two-channel multiplexer gate to switch between the input and
>>>output voltages, but that seems like a bit of waste in terms of devices
>>>and PCB space.
>>>
>>>Can anyone remember how this was done? Thanks already for any suggestions.
>>>
>>>Richard Rasker
>>
>>
>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>
>Yup, that was the one I meant -- so simple it's almost alarming that I
>couldn't remember. I must be getting old :-/

Aren't we all?

That circuit makes a nice synchronous detector.

>I can replace the switch with a small-signal MOSFET, and have the exact
>desired solution -- a few thents of an ohm Rdson are no problem with R=10K.
>
>> or
>>
>> ftp://jjlarkin.lmi.net/Gain_PM1_b.JPG
>>
>>
>> But the circuit you suggest, the inverter and the downstream mux, are
>> about equivalent. This does have a lower output impedance in both
>> states.
>
>Indeed it does -- but I think I'll just go with the first solution.
>
>Anyway, thanks so much, now I can get on with the really tricky bits :-)
>

Anything fun?

John

Richard Rasker

unread,
Jul 26, 2011, 5:03:15 PM7/26/11
to
Richard Rasker wrote:

> John Larkin wrote:
>
> [snip switchable inverter/non-inverter]


>
>>>>>Can anyone remember how this was done? Thanks already for any
>>>>>suggestions.
>>>>>
>>>>>Richard Rasker
>
>>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>>
>>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>>couldn't remember. I must be getting old :-/
>>
>> Aren't we all?
>>
>> That circuit makes a nice synchronous detector.
>

> It sure does.
>
> ...


>
>>>Anyway, thanks so much, now I can get on with the really tricky bits :-)
>>>
>>
>> Anything fun?
>

> It's a triangle wave sweep generator, with the lowest and highest voltage
> levels presettable by means of (multiturn) potmeters, and a reasonably
> fixed frequency of 1 Hz. IOW: it doesn't speed up or down with a smaller
> respectively wider sweep range, which is essential for reasons that I'm
> not allowed to discuss. Here's the schematic of most of it:
>
> http://www.linetec.nl/electronics/sweep-page1.ps
>
> I think this'll work (several parts are already built in a breadboard
> setup and tested), although I still have to double-check the polarity of
> the window detector / flip flop part at the center, controlling the MOSFET
> in your [non-]inverter.

And right after posting this, I spotted a dumb error: in 'Set' mode, the
MOSFET should be permanently switched on. Ah well, it's getting late --
I'll fix that tomorrow ...

Richard Rasker

unread,
Jul 26, 2011, 4:57:08 PM7/26/11
to
John Larkin wrote:

[snip switchable inverter/non-inverter]

>>>>Can anyone remember how this was done? Thanks already for any
>>>>suggestions.
>>>>
>>>>Richard Rasker

>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>
>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>couldn't remember. I must be getting old :-/
>
> Aren't we all?
>
> That circuit makes a nice synchronous detector.

It sure does.

...

>>Anyway, thanks so much, now I can get on with the really tricky bits :-)
>>
>
> Anything fun?

It's a triangle wave sweep generator, with the lowest and highest voltage


levels presettable by means of (multiturn) potmeters, and a reasonably
fixed frequency of 1 Hz. IOW: it doesn't speed up or down with a smaller
respectively wider sweep range, which is essential for reasons that I'm not
allowed to discuss. Here's the schematic of most of it:

http://www.linetec.nl/electronics/sweep-page1.ps

I think this'll work (several parts are already built in a breadboard setup
and tested), although I still have to double-check the polarity of the
window detector / flip flop part at the center, controlling the MOSFET in
your [non-]inverter.

Richard Rasker
--
http://www.linetec.nl

Jim Thompson

unread,
Jul 26, 2011, 6:26:02 PM7/26/11
to
On Tue, 26 Jul 2011 22:57:08 +0200, Richard Rasker <spam...@linetec.nl>
wrote:

>John Larkin wrote:


>
>[snip switchable inverter/non-inverter]
>
>>>>>Can anyone remember how this was done? Thanks already for any
>>>>>suggestions.
>>>>>
>>>>>Richard Rasker
>
>>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>>
>>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>>couldn't remember. I must be getting old :-/
>>
>> Aren't we all?
>>
>> That circuit makes a nice synchronous detector.
>
>It sure does.
>

[snip]

I put it in a hybrid for Hughes (Tucson) in 1971.

There's also a more accurate way. I'd post it but Larkin would claim it as
his own ;-) Interested parties inquire privately.

...Jim Thompson

[On the Road, in New York]
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.

John Larkin

unread,
Jul 26, 2011, 7:40:36 PM7/26/11
to
On Tue, 26 Jul 2011 18:26:02 -0400, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Tue, 26 Jul 2011 22:57:08 +0200, Richard Rasker <spam...@linetec.nl>
>wrote:
>
>>John Larkin wrote:
>>
>>[snip switchable inverter/non-inverter]
>>
>>>>>>Can anyone remember how this was done? Thanks already for any
>>>>>>suggestions.
>>>>>>
>>>>>>Richard Rasker
>>
>>>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>>>
>>>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>>>couldn't remember. I must be getting old :-/
>>>
>>> Aren't we all?
>>>
>>> That circuit makes a nice synchronous detector.
>>
>>It sure does.
>>
>[snip]
>
>I put it in a hybrid for Hughes (Tucson) in 1971.

I put it into the Boresight Alignment Kit for the C5A around 1968 or
so.

>
>There's also a more accurate way. I'd post it but Larkin would claim it as
>his own ;-) Interested parties inquire privately.

Hell, he never posts circuits any more; he just brags about past
glories. He's using me as an excuse for not having ideas. Senile old
fool.

What's a more accurate way to flip a DC voltage than using an opamp
and two equal-value resistors?


John

John Devereux

unread,
Jul 27, 2011, 3:21:40 AM7/27/11
to
Jim Thompson <To-Email-Use-Th...@On-My-Web-Site.com> writes:

> On Tue, 26 Jul 2011 22:57:08 +0200, Richard Rasker <spam...@linetec.nl>
> wrote:
>
>>John Larkin wrote:
>>
>>[snip switchable inverter/non-inverter]
>>
>>>>>>Can anyone remember how this was done? Thanks already for any
>>>>>>suggestions.
>>>>>>
>>>>>>Richard Rasker
>>
>>>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>>>
>>>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>>>couldn't remember. I must be getting old :-/
>>>
>>> Aren't we all?
>>>
>>> That circuit makes a nice synchronous detector.
>>
>>It sure does.
>>
> [snip]
>
> I put it in a hybrid for Hughes (Tucson) in 1971.
>
> There's also a more accurate way. I'd post it but Larkin would claim it as
> his own ;-) Interested parties inquire privately.

FFS Jim why do you bother posting here anymore?

--

John Devereux

John Devereux

unread,
Jul 27, 2011, 3:24:58 AM7/27/11
to
John Larkin <jjla...@highNOTlandTHIStechnologyPART.com> writes:

Switched capacitor? See e.g. fig 20 in

<http://cds.linear.com/docs/Application%20Note/an03f.pdf>

1ppm accuracy with no precision parts!

Pretty cool.

--

John Devereux

Jim Thompson

unread,
Jul 27, 2011, 7:42:10 AM7/27/11
to

I presume your E-mail address is accurate? I'll send you a schematic. If you
were paying attention, I do respond to _real_ requests for information. But
there's VERY few such requests anymore.

Larkin can't stop "cluck clucking", so I can't help but slam the little SOB.
When he shuts up, so will I.

What have YOU designed lately? That worked as requested ?:-) I've designed
nearly a whole SOC in the past two weeks.

John Devereux

unread,
Jul 27, 2011, 8:58:32 AM7/27/11
to
Jim Thompson <To-Email-Use-Th...@On-My-Web-Site.com> writes:

> On Wed, 27 Jul 2011 08:21:40 +0100, John Devereux <jo...@devereux.me.uk> wrote:
>
>>Jim Thompson <To-Email-Use-Th...@On-My-Web-Site.com> writes:
>>
>>> On Tue, 26 Jul 2011 22:57:08 +0200, Richard Rasker <spam...@linetec.nl>
>>> wrote:
>>>
>>>>John Larkin wrote:
>>>>
>>>>[snip switchable inverter/non-inverter]
>>>>
>>>>>>>>Can anyone remember how this was done? Thanks already for any
>>>>>>>>suggestions.
>>>>>>>>
>>>>>>>>Richard Rasker
>>>>
>>>>>>> ftp://jjlarkin.lmi.net/Gain_PM1.JPG
>>>>>>
>>>>>>Yup, that was the one I meant -- so simple it's almost alarming that I
>>>>>>couldn't remember. I must be getting old :-/
>>>>>
>>>>> Aren't we all?
>>>>>
>>>>> That circuit makes a nice synchronous detector.
>>>>
>>>>It sure does.
>>>>
>>> [snip]
>>>
>>> I put it in a hybrid for Hughes (Tucson) in 1971.
>>>
>>> There's also a more accurate way. I'd post it but Larkin would claim it as
>>> his own ;-) Interested parties inquire privately.
>>
>>FFS Jim why do you bother posting here anymore?
>
> I presume your E-mail address is accurate? I'll send you a schematic.

Yes

> If you were paying attention, I do respond to _real_ requests for
> information. But there's VERY few such requests anymore.
>
> Larkin can't stop "cluck clucking", so I can't help but slam the little SOB.
> When he shuts up, so will I.

When he shuts up? As far as I can see he gave the OP exactly what he was
after (the simple optional inverter circuit). Which is more than you
did.

I don't doubt there are other solutions, I posted one myself that was
"more accurate" at DC (depending on assumptions). But the OP was asking
for a specific circuit configuration he couldn't remember, it's the one
that everyone learns and JL at least took the trouble to sketch it and
post it.

> What have YOU designed lately? That worked as requested ?:-) I've designed
> nearly a whole SOC in the past two weeks.

Nothing very exciting I'm afraid. I think the last actual analog
electronics included the 4-20mA driver circuit that I asked for ideas
about a while ago, here.

I do have to do a lot of other stuff, programming, PCB layout, admin...

--

John Devereux

John Larkin

unread,
Jul 27, 2011, 12:35:01 PM7/27/11
to

Flying-capacitor circuits are cool. There are a couple of gotchas,
mostly related to charge injection and dielectric absorption. But no
resistor ratios to worry about.

John

John Larkin

unread,
Jul 27, 2011, 12:37:36 PM7/27/11
to
On Wed, 27 Jul 2011 13:58:32 +0100, John Devereux
<jo...@devereux.me.uk> wrote:

Be careful not to offend The (self proclaimed) Master Designer. He'll
killfile you, and then what would you do?

John

John Devereux

unread,
Jul 27, 2011, 2:14:41 PM7/27/11
to
John Larkin <jjla...@highNOTlandTHIStechnologyPART.com> writes:

Not in this circuit though I think.

> But no resistor ratios to worry about.

That's the key, 1ppm resistors are kind of pricy :)


--

John Devereux

whit3rd

unread,
Jul 27, 2011, 7:05:47 PM7/27/11
to
Well, you might consider a flying capacitor to be better in not requiring matched components. The switches get you into feedthrough of digital signals, though. It can also suffice sometimes to divide by two, then use the divide point as your GND reference.

dagmarg...@yahoo.com

unread,
Jul 27, 2011, 7:06:34 PM7/27/11
to
On Jul 26, 6:26 pm, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:

> There's also a more accurate way.  I'd post it but Larkin would claim it as
> his own ;-)  Interested parties inquire privately.

Why are you worried about Larkin--if you post it here we'll ALL steal
it. That's the idea, isn't it?

Here's part of the low-voltage lock-out of my switch: an ancient
Schmitt-trigger.


+24v
-+-
|
R2 1K
|
+-------.
| |
R1 |<' |<'
--10K--| Q1 .--| Q2
|\ | |\
| | |
+--' |
| +---> 'HI' = disable
R4 47K |
| RL
| |
=== ===

I used it because it's rugged, simple, never goes out of style, works
fine on +24v, and because I can be absolutely certain of its exact
behavior at all supply voltages. (It's a safety--the switch /must
not/ throw if success is uncertain, e.g. low supply voltage, lest it
vaporize the FETs.) I also needed a voltage-source output.

--
Cheers,

James Arthur

John Larkin

unread,
Jul 27, 2011, 7:20:45 PM7/27/11
to
On Wed, 27 Jul 2011 16:06:34 -0700 (PDT), dagmarg...@yahoo.com
wrote:

>On Jul 26, 6:26�pm, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
>Web-Site.com> wrote:
>
>> There's also a more accurate way. �I'd post it but Larkin would claim it as
>> his own ;-) �Interested parties inquire privately.
>
>Why are you worried about Larkin--if you post it here we'll ALL steal
>it. That's the idea, isn't it?

He won't post anything any more. Because...

1) I'll steal it?

2) He has no ideas?

John

Fred Bloggs

unread,
Jul 28, 2011, 1:07:23 PM7/28/11
to
On Jul 26, 4:57 pm, Richard Rasker <spamt...@linetec.nl> wrote:
>
> It's a triangle wave sweep generator, with the lowest and highest voltage
> levels presettable by means of (multiturn) potmeters, and a reasonably
> fixed frequency of 1 Hz. IOW: it doesn't speed up or down with a smaller
> respectively wider sweep range, which is essential for reasons that I'm not
> allowed to discuss. Here's the schematic of most of it:
>
> http://www.linetec.nl/electronics/sweep-page1.ps
>
> I think this'll work (several parts are already built in a breadboard setup
> and tested), although I still have to double-check the polarity of the
> window detector / flip flop part at the center, controlling the MOSFET in
> your [non-]inverter.

You would be better off using a fixed amplitude and frequency triangle
waveform generator followed by an adjustable gain amplifier/buffer to
set the output amplitude, instead of running those adjustable inputs
all over the place...

David Eather

unread,
Jul 29, 2011, 1:07:53 AM7/29/11
to

You don't mean something like this?

http://www.easy-share.com/1916972881/sign changer.gif

Richard Rasker

unread,
Jul 29, 2011, 5:42:16 AM7/29/11
to
Fred Bloggs wrote:

That would admittedly be much easier, but one of the prerequisites in this
case is that the lowest and highest output values can be set (semi-)
independently and accurately. I found no way of doing this using adjustable
gain and offset.


Richard Rasker
--
http://www.linetec.nl/

Fred Bartoli

unread,
Jul 29, 2011, 4:05:45 PM7/29/11
to
Richard Rasker a �crit :

How about having your switchover points fixed as you want. Then just
derive the integrated current values from the switch points deltaV.

Trim to get 1Hz
|
G=1 inst amp | ||
| .----||-.
HC4053 V | || |
|\ +--------o ___ | |\ |
Vlow >-------|-\ | .----. \o-|___|-+--|-\ |
| >-+-| -1 |-o | >-+
Vhigh >-------|+/ '----' ^ GND-|+/ |
|/ | |/ |
| |
| /| |
| .---. /+|------< Vlow
| | S|--< | |
| | | \-|--+
'--o| R|-. \| |
'---' | |
| /| |
| /+|--'
'< |
\-|------< Vhigh
\|


--
Thanks,
Fred.

Richard Rasker

unread,
Jul 30, 2011, 7:07:12 AM7/30/11
to
Fred Bartoli <" "> wrote:

> Richard Rasker a écrit :

Fred,
Not to put too fine a point on it, but this is pretty much what I came up
with in the first place (refer to
http://www.linetec.nl/electronics/sweep-page1.ps):
- U3 p8/9/10 provides the difference between Vlow and Vhigh
- U3 p1/2/3 is the switchable inverter/non-inverter, with a MOSFET
instead of a 4053
- U3 p12/13/14 is the integrator
- U2 p1/2/3 and p12/13/14 are the comparators
- U2 p5/6/7 is configured as flip-flop

But thanks for your effort anyway -- you've come up with some real gems in
the past, among which a very elegant log converter circuit for a mass air
flow sensor, which is still in use :-)

Fred Bartoli

unread,
Jul 30, 2011, 9:21:32 AM7/30/11
to


Ahem, OK, I missed it. Pretty much the same indeed.


> But thanks for your effort anyway -- you've come up with some real gems in
> the past, among which a very elegant log converter circuit for a mass air
> flow sensor, which is still in use :-)
>

Glad it helped :-)

--
Thanks,
Fred.

sclarke

unread,
Sep 14, 2011, 5:34:46 PM9/14/11
to
Sorry for resurrecting an old (and entertaining!) thread here, but I have a
very similar design problem. I have a 0 – 4 V analog control signal
("A_abs") that I need to selectively invert with a 5V output line from a
µP. A_abs is updated at 40 Hz so no fancy high speed stuff should be
needed (but phase/time delays from filters are not ideal also).

It seems like the circuit on page 2 of this PDF would do the trick
(basically the same as the one shown in the sweep-page1.ps document), but
A_abs is usually less than 100 mV and the error introduced by the V_CE≠0
adds an offset onto the output. Any ideas that I can breadboard before I
send my PCB out for fab? I may just go with the MUX idea mentioned up front
here.

http://www.niu.edu/~mfortner/labelec/lect/p575_03b.pdf

--Sean Clarke



---------------------------------------
Posted through http://www.Electronics-Related.com

Kaz Kylheku

unread,
Sep 14, 2011, 10:44:20 PM9/14/11
to
On 2011-09-14, sclarke <electronics-related.com@n_o_s_p_a_m.seanclarke.net> wrote:
> It seems like the circuit on page 2 of this PDF would do the trick
> (basically the same as the one shown in the sweep-page1.ps document), but
> A_abs is usually less than 100 mV and the error introduced by the V_CE≠0
> adds an offset onto the output.

Hi sclarke. Forget the bipolar transistor. Although some have a very low
VCE(sat), especially when the collector current is small, it could still
be significant w.r.t. 0.1V.

Consider a MOSFET, or an IC providing analog switches.

With some analog switching/multiplexing you could also implement a
solution whereby you split the signal between a buffer and inverter, and
then multiplex on the output side.

Sean Clarke

unread,
Sep 15, 2011, 4:15:47 PM9/15/11
to
On Sep 14, 7:44 pm, Kaz Kylheku <k...@kylheku.com> wrote:
> Hi sclarke. Forget the bipolar transistor. Although some have a very low
> VCE(sat), especially when the collector current is small, it could still
> be significant w.r.t. 0.1V.
>
> Consider a MOSFET, or an IC providing analog switches.
>
> With some analog switching/multiplexing you could also implement a
> solution whereby you split the signal between a buffer and inverter, and
> then multiplex on the output side.

Thanks for the response, Kaz. The MUX on the output is probably the
way to go for me. I haven't done electronics design in a long time and
I haven't had much luck getting the SPICE model to work correctly when
I use a MOSFET.

Does anyone have a suggestion for a MUX? Are there "Make before Break"
models? My 'A_abs' signal is actually an input to a flight control
system on an aircraft, and after this follower/inverter stage it goes
through an instrument amp and another buffer stage so I don't want
there to be a risk of the MUX terminal developing a stray voltage for
the brief moment that it's floating during switching as this could be
amplified. As a fall back I may just add a large pull-down resistor.
0 new messages