Go Down

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

olol

Hello World !

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 don't want to use a voltage divider with resistors, because I lose precision. I would like to use a Op-amp to shift the signal from 9v-14v to 0v-5v. With a Op-amp with a substract circuit I can substract my signal with a 9v regulated voltage...

Q1) Could you tell me if my reasoning is good ?
Q2) I don't have a symmetric power supply (+/- 14v) on my motor, can I put the Vcc- to GND and the Vcc+ to 14v ?
Q3) As my input and my output are close from the Op-amp power supply, I guess that I need a rail-to-rail Op-amp ?
Q4) What Op-amp should I buy for my project ? Preferably in DIP package.
Does the TLV2370 or the LMC6482 could works ?

Thanks,
Regards.

Paul__B

  • Sort of.  You don't need a 9V reference, you need an accurate reference of any reasonable voltage, such as 5.
  • That's what you would do.
  • Indeed.
  • I don't know either, but someone else likely does.

olol

Hi Paul,

Thanks for you reply.


Q1) In my circuit, the output will be Vout = (V2 - V1), where V2 = my signal 9v-14v and V1 = my 9v reference. Like that when my signal is at 14v the output will be 5v and when the signal is at 9v my output will be 0v. Is it correct ?

Paul__B

You don't need a 9V reference.  You don't need the op-amp to be powered from 15V.

Let's start with a rail-to-rail op-amp operating at 5V, and a 5V reference.  (This has the great advantage that there is no way it can feed an excess voltage into the Arduino :smiley-grin: )  OK, let's divide the input voltage by three with a voltage divider - let's say a 22k resistor to ground and a 47k resistor to your voltage to be measured (assuming that connecting a 69k load to that voltage will not cause problems).  This voltage divider feeds the "+" input of your op-amp.

To cause the output of the op-amp to mirror the input, you connect the same divider between the op-amp output and the "-" input (that is, 47k from output to "-", 22k from "-" to ground).  The op-amp will now keep its output at the same voltage as the input to the circuit.

But you want an offset.  OK, let's not connect the 22k that is part of the voltage divider at the "-" input of the op-amp to ground, let's instead connect it to, say, 4.2V.

Now when your input voltage is 9V, there will be 2.87V on the "+" input of the op-amp and in order for the "-" input of the op-amp to be the same voltage, it will have to pull its output to ground - which is where you desire it to be when you have 9V on the input.

On the other hand, when you have 14V on the input, the "+" input to the op-amp will be at 4.46V and to match the "-" input, the op-amp will have to output 5V - again, exactly what you want!

The only remaining problem is deriving that 4.2V reference.  To do this you replace the 22k resistor to the op-amp "-" input with two resistors, one to ground and one to your 5V (or any other) reference such that their parallel resistance is 22k.  I leave you to figure out that calculation! :smiley-lol:

raschemmel

Quote
I don't want to use a voltage divider with resistors, because I lose precision.
If you want better precision , you should start with better resolution
16-ADC

MarkT

Yes, resistor divider, an ADC with more than 10 bits of resolution and a precision voltage
reference would do better than a difference circuit - finding a precision 9V reference doesn't
sound likely, 4.096V references on the other hand are plentiful.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

raschemmel

Quote
Yes, resistor divider, an ADC with more than 10 bits of resolution and a precision voltage
reference would do better than a difference circuit 
a precision divider requires precision resistors (1%,0.1% etc.)

Wawa

If you're happy with the 10-bit precision and the 5volt ref of the Arduino, then I think you could shift the voltage with one rail to rail out opamp, supplied from Arduino's 5volt rail.

Basic circuit:
Step down the 9-14volt with a resistor divider to e.g. 0.9-1.4volt, and feed that into the +in of the opamp.
Three resistors with starpoint to -in of the opamp.
~1k to ground, ~10k to opamp output, ~4k1 to +5volt.
Values have to be calculated/finetuned.
Leo..

TomGeorge

Hi,

Find wawa circuit  attached.

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

Wawa

Thank you TomGeorge. Didn't have time to draw it up.
Looks good, except for the 4-14v label.
That should be 9-14volt.
Leo..

Paul__B

That's good.

I thought someone might draw up my circuit for me. :smiley-grin:

TomGeorge

Hi,
Glad to be of service, error corrected...

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

raschemmel

#12
Jun 02, 2015, 04:36 pm Last Edit: Jun 02, 2015, 04:44 pm by raschemmel
@Wawa,
Dumb question;
I recognize the Gain of 11 non-inverting amplifier but what is the purpose of the 4k pullup on the -V pin ?
That should yield a voltage divider output of 1.0 V. Is that how you offset the circuit to 0.9 to 1.4V ?
(by biasing the virtual ground)

Robert

Wawa

#13
Jun 03, 2015, 12:30 am Last Edit: Jun 03, 2015, 01:11 am by Wawa
Hi raschemmel.
I have just picked some resistor values out of my hat that worked. Could have done better by calculating them.
I think this might be the way to do it properly (please correct me if I'm wrong).

Find the center voltage between 9v and 14v >> 11.5volt.
Calculate the input voltage divider so that 11.5volt on the input gives half of the opamp's rail voltage (2.5volt).
e.g. 18k/5k.
Pick equal values for R3 and R4.
e.g. 2x4k7
The opamp's output, with 11.5volt input, will now be mid-voltage (2.5volt). Independent of the value of R5.
R5 gives the required deviation of 9-14volt by changing the virtual ground (-input).
~8k2 should do it.
Leo

Archibald

I think this might be the way to do it properly (please correct me if I'm wrong).

Find the center voltage between 9v and 14v >> 11.5volt.
Calculate the input voltage divider so that 11.5volt on the input gives half of the opamp's rail voltage (2.5volt).
e.g. 18k/5k.
Pick equal values for R3 and R4.
e.g. 2x4k7
The opamp's output, with 11.5volt input, will now be mid-voltage (2.5volt). Independent of the value of R5.
R5 gives the required deviation of 9-14volt by changing the virtual ground (-input).
~8k2 should do it.
Using your choice of resistors, the voltage divider formed by R1 and R2 has a gain of 5/(18+5) = 0.217.

The amplifier has a gain of (R5+R3//R4)/(R3//R4) = (R5+2.35)/2.35.

As you want an input swing of 14V to 9V to give an output swing of 5V to 0V you need an overall gain of 1. So
0.217 x (R5+2.35)/2.35 = 1

Giving R5 = 8.46KΩ.


Go Up