# opamp voltage shift

#### sealdogfish

Joined Nov 15, 2011
15
Hi, I have an opamp AD8666 and need to amplify and shift an input signal 1.6 - 1.9v to output 0 - 2v

I have this circuit:

It has the correct amplification but I need to shift the voltage before amplifying somehow, any ideas?

Thanks

#### sealdogfish

Joined Nov 15, 2011
15
I understand that if I use 1.5V as a reference to the opamp it will then treat the 1.5 to 2v input as 0 to 0.5v, Where does the reference connect to?

#### sealdogfish

Joined Nov 15, 2011
15
I think that the negative input of the second stage (pin 6) should be connected to the 1.5V reference through the 1k resistor?

#### sealdogfish

Joined Nov 15, 2011
15
Actually the negative from the first stage would probably be best I think

#### praondevou

Joined Jul 9, 2011
2,942
Actually Opamps have non-linear behaviour near zero. So when using a single supply it will be difficult to get near zero maintaining linear amplification. Does this go to a uC?
Since you have a power supply of 3.3V and an output range of 2V do you think you could live with an DC offset of a few hundred mV?

#### sealdogfish

Joined Nov 15, 2011
15
Yes a few hundred mV is fine, I don't actually need it to get near 0, How about a 1.3V reference?

#### SgtWookie

Joined Jul 17, 2007
22,230
Here, try it like the attached instead.

I'm too tired at the moment to figure out why R1 wants to be 23k instead of 20k like it should be.

Basically, I'm subtracting ~1.9v from the input signal, and accounting for the input offsets in the process by establishing the reference voltage node "subin"; and using U1a as a voltage follower/buffer.

The voltage at node "sub" is actively maintained by U1a.

The signal then gets multiplied by 2.3 (R1/R2), and you wind up with 1v to 2v out.

I tried the AD8657 opamp briefly, but I got some very odd results and don't have the energy left to debug that this evening.

#### Attachments

• 136.4 KB Views: 42

#### praondevou

Joined Jul 9, 2011
2,942
In theory this should do it. The thing is to find the right Opamp, the LF412 will definitely not do it.

The 82k adjusts the offset. The right amp provides the gain.

If you need high impedance at the input you can put a voltage follower at the input.

The output goes from 0.8V to 2.8V for 1.6V to 1.9V input.

Edit: I really should refresh my browser before posting.

#### Attachments

• 16.9 KB Views: 44

#### sealdogfish

Joined Nov 15, 2011
15
Oh sorry I just used the first op amp symbol I came across, it's actually an AD8666

#### praondevou

Joined Jul 9, 2011
2,942
The AD8666 should do it, according to the datasheet it's output goes almost to the rails. The real-world results, however, can always be different from the simulation results. I just took a few minutes to build the circuit with a LM258 and it works, after adjustments being made. (2V range is at the LM's limit).

#### SgtWookie

Joined Jul 17, 2007
22,230
Analog Devices does not have a published SPICE model for the AD8666, which is why I did not attempt to simulate it. However, the AD8657 is recommended for new designs on the AD8666 page as a low power 18v alternative:

With the AD8657, I had a very non-linear output response. I didn't read through the datasheet to try to figure out why that was occurring.

They also recommend the AD8546 as an alternative. I didn't try that one (yet).

[...some time passes...]

The non-linearity I was seeing appears to be due to the low-power nature of these two particular opamps; with R2 being 10k, the output of U1a looked like a couple of rounded-off mountains. Increasing R1 & R2 up to 7.5 times their original values improved that quite a bit, but by then the plot looked the path of a skipping stone.

With R1/R2 at around 10x the original values, the output of U1a began oscillating when the output was lightly loaded. Analog's website says that both opamps are stable with unity gain, so their SPICE models do not seem to follow their datasheets under these conditions. I added a 100nF cap to the output of U1a which stopped the oscillations, but that should not be necessary.

As the AD8666 is a different opamp, it will perform differently.

You can't simulate an AD8666 using the model for an LF412. They're very different.

I tried using the LF412 in the circuit; and it will not work. It's I/O range is not sufficient; it is only linear between about 1.5v and 1.8v.

[eta]
I guess I was fooling around with this longer than I thought. I'd started well before praondevou's reply.

I tried the LM358 in the simulation (same specs as the 158 & 258 except temp range) and it appears to work; HOWEVER!
The LMx58 is not specified for RRIO, and it's not very specific on how high the output will go under load. The output appears to be able to go as high as +V - 0.7v, but I'll take that number with a pound of salt (I am skeptical). I suspect that your mileage will vary from the simulation results; but I don't have any 358's on hand to test it with.

Last edited:

#### praondevou

Joined Jul 9, 2011
2,942
I tried the LM358 in the simulation (same specs as the 158 & 258 except temp range) and it appears to work; HOWEVER!
The LMx58 is not specified for RRIO, and it's not very specific on how high the output will go under load. The output appears to be able to go as high as +V - 0.7v, but I'll take that number with a pound of salt (I am skeptical). I suspect that your mileage will vary from the simulation results; but I don't have any 358's on hand to test it with.
Yes, you are right, the LM is not suitable for this low power supply voltage, especially if you want an output range of more than 1.8V. I tested it with a triangle input and it looked quite linear at the output though...Actually I only tested it because I never used it with 3.3V and I was curious about how it behaves.

#### SgtWookie

Joined Jul 17, 2007
22,230
Yes, you are right, the LM is not suitable for this low power supply voltage, especially if you want an output range of more than 1.8V. I tested it with a triangle input and it looked quite linear at the output though...Actually I only tested it because I never used it with 3.3V and I was curious about how it behaves.
Well, it IS specified to operate with a Vcc as low as +3v; and our OP is 300mV over that.

I'm just thinking that there is a good probability that the output will be hard-pressed to get up to 2v. It's kind of "pushing our luck", and having to "make a guess". I'd really prefer to stick with a part that has specifications which cover all of the required parameters, as that's one less thing to go wrong.

Murphy can be exceptionally cruel.

#### sealdogfish

Joined Nov 15, 2011
15
Hi, thanks for the replies, I am using a different sensor now with an output of 6.07V to 6.21V, I used your diagram praondevou and modified it to the following:

Now the output will work (270mv to 360mv) but I would like it to be amplified a little more if possible, I have never used opamps before if you couldn't tell and I can't seem to get the opamps working correctly in LTSpice.
What values would I need to change to increase the amplification?

#### praondevou

Joined Jul 9, 2011
2,942
You can change both the 39k resistors. What output voltage do you want? What will be your reference voltage?

#### sealdogfish

Joined Nov 15, 2011
15
I would like an output of .5 to 3v or round abouts, so I can get the most accurate reading from the 32bit AVR
The reference voltage from the output of the first stage? It's around 5.5V, maybe I should increase it a bit.

#### praondevou

Joined Jul 9, 2011
2,942
Quick question, is this Homework?

140mV to 2.5V gives you a gain of almost 18, this is set by the second Opamp.
The value you want to subtract from the input voltage is set by the reference made by the first Opamp. Note that the smaller the input voltage gets the more precise needs to be the reference, if made with an Opamp whose input DC offset drifts to much with temperature it will be difficult to get consistent readings at the output.

If you want to use still lower input signals probably something different needs to be used.

#### Attachments

• 94 KB Views: 54

#### sealdogfish

Joined Nov 15, 2011
15
It's not homework, It's a project I'm working on, a spirometer/flow meter, the sensor is a honeywell pressure sensor: DCXL05DS

#### sealdogfish

Joined Nov 15, 2011
15
Thank you, Ill give that a go and see what I get

#### praondevou

Joined Jul 9, 2011
2,942
honeywell pressure sensor: DCXL05DS
That's like a strain gage, why do get 6V from it? The voltage difference at it's output should be zero without pressure.

If you google (images) "strain gage single supply opamp" you will find some examples on how to do this too.

example:

Note that the excitation voltage needs to be EXTREMELY stable, changes in voltage will cause erroneous readings.