Go Down

Topic: Op-amp subtractor (Read 7923 times) previous topic - next topic

raschemmel

#30
Jun 05, 2015, 02:51 am Last Edit: Jun 05, 2015, 04:24 am by raschemmel
@Wawa,

Ok I breadboarded your original circuit with as close to your original values as I could get:

R1: 17.56 k
R2: 5 k
R3: 3.75 k (Lowered from 4.7 k to adjust Gain to fit the range 9V to 14V in to Vdivider)
R4: 4.64 k
R5: 8.44 k


Input Voltage  VDo_OA_In  AmplifierOutput

9.0 V                   2.000 V                 0.012 V  
10.0 V                  2.227 V                0.314 V
11.0  V                 2.451  V               1.295 V
12.0 V                  2.663 V                 2.356 V
13.0 V                  2.875 V                 3.43 V
14 V                     3.099 V                 4.31 V (saturated at rail)

The circuit works as advertised (ignoring the fact that I don't have a rail-to-rail O/A.
(See attached PDF file for graph of gain.)

Truthfully, that's my first time using a voltage divider to bias the Virtual Grnd (-V pin) of an op amp. I must admit I was a bit skeptical but after seeing it work it really is pretty straight forward.


Quote
The amplifier has a gain of (R5+R3 || R4)/(R3 || R4) = (R5+2.35)/2.35.
[Edited]


that appears to mean 8.46 k + 2.35 (the parallel combination of two 4.7 k resistors)/
2.35 = 4.6  (8.46+2.35)/2.35 = 4.6


My resistor values:

R1: 17.56 k
R2: 5 k
R3: 3.75 k (Lowered from 4.7 k to adjust Gain to fit the range 9V to 14V in to Vdivider)
R4: 4.64 k
R5: 8.44 k

(R5+R3 || R4)/(R3 || R4) = (R5+2.35)/2.35
=8.44 k + (3.75 k || 4.64 k) = (8.44 k + 2.07)/2.07 = 6.15


The only question I have is why is the gain NOT consistent ?
The slope of the ramp (from the graph) is about 45 degrees starting with a gain of 0 and ending with a gain of approximately 6.15.

This is obviously the result of R3.
Conclusion: If you add a resistor between the -V op amp input pin and Vcc, the gain
becomes a function of the input voltage.
With Vin = 9V, the voltage on the -V pin = 2.200 V.
With Vin = 14V, the voltage on the -V pin = 3.049 V.

This may make perfect sense from an op amp standpoint but it nevertheless comes as a surprise because instead of a consistent non-inverting amplifier behavior , with a consistent gain across the board, you have look at the graph to predict what output you can expect for some given input. The criteria for the circuit was
Vout = Vin-9V
Thus ,
Vin         Vin-9V
9 V            0 V
10 V            1 V
11 V            2 V
12 V            3 V
13 V            4 V
14 V            5 V


Quote
I would like to compute my motor tachometer's signal. This signal is a variable voltage going from 9v to 14v.
As Arduino can only accept signals from 0v to 5v on analog inputs, I have to decrease my signal's voltage.
I think the classic op amp subtractor (Differential amplifier) would deliver output values much closer to the above table. It would be nice if the OP would come back
and clarify WHY he needs this circuit and if my above assumptions are correct.

Paul__B

Is this what you meant ?
(see attached)
No, it is a bit muddled!

Either you have the required reference voltage of 4.2V, or you emulate it with a pair of resistors which would - as a divider on their own - provide that voltage but whose parallel resistance combines with the other resistor to match the gain of the divider in the "+" arm of the op-amp.  {It is as you gather, correct practice to make the impedance in both "+" and "-" arms of the op-amp, equal.}

Using three resistors together allows you to synthesise the 4.2V reference from a 5V - or just as easily, a 9 or 12V - reference; if you had an actual 4.2V, you would need only the two resistors.

raschemmel

I'm sorry, I can't visualize it without a schematic.

olol

Hello,



Thank you everybody to look at my question. Sorry for the late, but I have had a lot of work this week.

I ordered a 16bit-ADC, it will be useful :)

There is a long time I lost you :( I'm not familiar with electronics...


I think the classic op amp subtractor (Differential amplifier) would deliver output values much closer to the above table. It would be nice if the OP would come back
and clarify WHY he needs this circuit and if my above assumptions are correct.
I need this circuit because I buy a motorbike (Honda CBR 600 RR) without dashboard. A new dashboard cost a lot, so I want to create a custom one with Arduino. I found the wiring diagram to know which cable I need to use.

Unfortunately I don't have a ocilloscope, so I don't know if it's square signal, but I know that the voltage goes from 9v to 14v when the motor speed goes from 0rpm to 14000rpm...


This may make perfect sense from an op amp standpoint but it nevertheless comes as a surprise because instead of a consistent non-inverting amplifier behavior , with a consistent gain across the board, you have look at the graph to predict what output you can expect for some given input. The criteria for the circuit was
Vout = Vin-9V
Thus ,
Vin         Vin-9V
9 V            0 V
10 V            1 V
11 V            2 V
12 V            3 V
13 V            4 V
14 V            5 V
This is exactly what I need.

raschemmel

Thanks for the explanation. Actually , I just didn't read your original post well enough. I found the following in that post: Your lastest explanation is more detailed but to be truthful , the oversight was on my part , not yours.

Quote
I would like to compute my motor tachometer's signal. This signal is a variable voltage going from 9v to 14v.
As Arduino can only accept signals from 0v to 5v on analog inputs, I have to decrease my signal's voltage. 
I will experiment with the differential amplifier this weekend to see if it is more accurate. As you can see from the graph in the PDF file attached to Reply#30, the response, though consistent with your requuired range, is not as linear as I had expected. For a motorbike , on the other hand, it is probably
adequate. Having owned one, the main concern is not so much exactly what your RPM is, as it is are you exceeding the REDLINE !

polymorph

Quote
The only question I have is why is the gain NOT consistent ?
The slope of the ramp (from the graph) is about 45 degrees starting with a gain of 0 and ending with a gain of approximately 6.15.

This is obviously the result of R3.
Conclusion: If you add a resistor between the -V op amp input pin and Vcc, the gain
becomes a function of the input voltage.
With Vin = 9V, the voltage on the -V pin = 2.200 V.
With Vin = 14V, the voltage on the -V pin = 3.049 V.

This may make perfect sense from an op amp standpoint but it nevertheless comes as a surprise because instead of a consistent non-inverting amplifier behavior , with a consistent gain across the board, you have look at the graph to predict what output you can expect for some given input. The criteria for the circuit was
Vout = Vin-9V
Thus ,
Vin         Vin-9V
9 V            0 V
10 V            1 V
11 V            2 V
12 V            3 V
13 V            4 V
14 V            5 V
But that -is- consistent gain. With 9V subtracted first, the gain is Vout/(Vin-9V) = 1 at all levels.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

raschemmel

#36
Jun 05, 2015, 09:45 pm Last Edit: Jun 05, 2015, 11:13 pm by raschemmel
Are you looking at the PDF file?

But now that you mention it, I just reread all my posts. and realized that nowhere did I post the voltage on the -V input of the op amp.. If my memory serves me right it was 2.200V.
I'll check it when I get home and post it. My bad.

polymorph

Is there a schematic here somewhere? I came up with different numbers than you did, but it is not linear. Which Op Amp? I'm unwilling to comb through three pages looking.

I used Vout/(Vin-9), so I could not enter that formula for the 9V input value.


9 0.012
10 0.319 0.319
11 1.295 0.6475
12 2.356 0.785333333
13 3.43 0.8575
14 4.31 0.862
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

raschemmel

#38
Jun 05, 2015, 11:33 pm Last Edit: Jun 05, 2015, 11:40 pm by raschemmel
I'll redo it tonight and post a different schematic than Wawa's , which is the one I used. I'' post an update by Monday morning. ( It's 1435 hrs here
June 5th,  now PST, USA. ( forum time is 7 hours ahead of PST.

polymorph

I'll try and take a few minutes tonight to put something in LTSpice.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

raschemmel

I'm going to try two different approaches:
1- Classic Differential Amp running on 16V.
     All resistors same value.
     9V on - V input inverting amp
     9V to 14 V on +V input non inverting amp.

2+ Wawa circuit (attached to one of the posts)

Paul__B

But now that you mention it, I just reread all my posts. and realized that nowhere did I post the voltage on the -V input of the op amp.. If my memory serves me right it was 2.200V.
But how could you measure it?

raschemmel

#42
Jun 06, 2015, 01:20 am Last Edit: Jun 06, 2015, 01:26 am by raschemmel
With a meter. With R3 , it isn't zero .

See Wawa'a circuit

R3 is  a 4.7 k pull up to +5V

Paul__B

You would have to ensure that the meter had a high input impedance.

raschemmel

If it's not a Fluke, it's not  a meter.

Go Up