# Simultaneous use of inverting and noninverting op amp inputs

#### rscgln

Joined Sep 14, 2018
11
Hello, it is quite clear to me how to use an op-amp in inverting mode, to get 0 or -5V with a 0 or +5V input and, as well, it is clear how to get 0 or +5V with a 0 or +5V input with noninverting mode. It is also clear how to get, for instance, -12V or +12V output with the appropriate supply and the correct resistors but my need is to achieve both functions simultaneously. I.E. I need to generate an output of +12V, 0V and -12V, presumably using TWO input wires (A, B) that can be 0V or +5V. I am pretty sure I can do this: A=0V B=0V out = 0V, A=5V B=0V out=+12V, A=0V B=5V out=-12V (A=5V B=5V undefined) but I cannot figure how. Can someone give a suggestion? Thanks

#### ericgibbs

Joined Jan 29, 2010
10,846
hi rs,
Welcome to AAC.
Your description suggests that the Ai,Bi inputs are 0v or 5v and the outputs Ao and Bo are are +12v , 0, or -12v.
Are these digital input signals ie: 0v or 5v or do they cover the range of 0v thru +5v.?? with a corresponding +/-0v thru +/-12v ;ie : analog.?

Eric

eg: if Ai or Bi = +2.5v would Ao or Bo be +/-6v

Last edited:

#### rscgln

Joined Sep 14, 2018
11
hi rs,
Your description suggests that the Ai,Bi inputs are 0v or 5v and the outputs Ao and Bo are are +12v , 0, or -12v.
Are these digital input signals ie: 0v or 5v or do they cover the range of 0v thru +5v.?? with a corresponding +/-0v thru +/-12v ;ie : analog.?

Eric
Yes, the inputs are digital, so no intermediate values. But I fear I was not very clear in my question: I need to use ONE single op amp and the only one output should be +12, 0 or -12 (no intermediate values) based on two input signals. Basically, my real need is to "generate" +12, 0 and -12 on one "wire" using Arduino or something like. Of course, I could use more than 2 input signals, if needed. Op amp was what I thought a simple solution but it is not a must.

#### ebeowulf17

Joined Aug 12, 2014
3,274
hi rs,
Welcome to AAC.
Your description suggests that the Ai,Bi inputs are 0v or 5v and the outputs Ao and Bo are are +12v , 0, or -12v.
Are these digital input signals ie: 0v or 5v or do they cover the range of 0v thru +5v.?? with a corresponding +/-0v thru +/-12v ;ie : analog.?

Eric

eg: if Ai or Bi = +2.5v would Ao or Bo be +/-6v
We'll see what the TS says, but it sounded to me like there's only one output. I think an amp with a gain of 2.4 would handle the specific values requested... but as you pointed out other value combinations where the difference between Ai and Bi is something other than -5, 0, or +5 would have correspondingly different output values.

#### rscgln

Joined Sep 14, 2018
11
where the difference between Ai and Bi is something other than -5, 0, or +5 would have correspondingly different output values.
That will not happen and, in any case, it wouldn't be a problem.

#### ebeowulf17

Joined Aug 12, 2014
3,274
That will not happen and, in any case, it wouldn't be a problem.
Cool!

I'm guessing from your description of past experiences that you've previously configured op amps with positive feedback to guarantee digital outputs with hysteresis.

In order to do what you've described here, i think all you have to do is set up an amp with a gain of 2.4, which will rely on negative feedback.

I'm under the weather, and still waking up, so l don't trust my brain right now. If I get a chance later today I'll try to sim the simple amp idea. In the meantime, if you're not already familiar with the ideas, do a little reading on positive vs. negative feedback in op amp circuits. If I'm remembering things correctly, your requirements can be met with a pretty simple setup - maybe you'll have it figured out before I even have time to sim it!

Joined Mar 10, 2018
4,057
Any constraints on speed / delay input to output ?

Regards, Dana.

#### rscgln

Joined Sep 14, 2018
11
Any constraints on speed / delay input to output ?

Regards, Dana.
No problem at all! The frequency, anyway, is very low: from 10 to 100Hz!

I am working on that 2.4 gain idea and it looks promising, with a couple of identical resistors connected to my two digital pins, centre on a 3rd resistor on the inverting input to have 0, 2.5 and 5v, 2.4 gain, some feedback... I have just to check how to "offset" but I am confident I will find a solution. Unfortunately now I have to leave, but I will continue later on.

#### ebeowulf17

Joined Aug 12, 2014
3,274
Hrmmm...

I think I may have been remembering things wrong. I think the "simple" amps I'm thinking of always have one of the inputs held at a stable voltage, often at ground potential. I think what I was imagining might require an instrumentation amp (or its home-spun 3-op-amp equivalent, which can be made with a single quad op amp IC.)

I'll give it some more thought, cause I need to get better at understanding these circuits anyway, but don't be surprised if my first idea turns out to be a dead end.

#### ebeowulf17

Joined Aug 12, 2014
3,274
Maybe this? (The differential one on the left.) Set Rf to 2.4 times Rin?

#### Kjeldgaard

Joined Apr 7, 2016
411
Could it be a differential amplifier with a gain of 2.4 times?

A quick sketch:

#### Alec_t

Joined Sep 17, 2013
11,665
You could do it with a few discretes, like this :-

#### ebeowulf17

Joined Aug 12, 2014
3,274

#### Attachments

• 1.8 KB Views: 0

#### rscgln

Joined Sep 14, 2018
11
Yep, just got done simulating the same!
View attachment 159878
Yes, I think this as well as Kjeldgaard's, are the simplest solutions and what I was looking for!
I will arrange this configuration.

Thanks a lot for all your effort!

#### ScottWang

Joined Aug 23, 2012
6,935
Could it be a differential amplifier with a gain of 2.4 times?

A quick sketch:
View attachment 159875
The output +12V and -12V should be exchange.

The TS shown at the last two lines in the #1 as :
A=5V B=0V out=+12V,
A=0V B=5V out=-12V