# Trying to build an op amp circuit with voltage shifting

Discussion in 'The Projects Forum' started by marcelosouza, Aug 15, 2016.

1. ### marcelosouza Thread Starter New Member

Aug 12, 2016
3
0
Hi. I'm a newbie when it comes to electronics so be patient with me. I am trying to figure out a circuit that allows me to convert a signal of -0.55V ~ +1.5V that is generated by a LM35 IC temperature sensor to 0V ~ +2.4V.
So, I think a op amp with an additional voltage shift to bring the -0.55V of the input to zero would do the job. This is where I am right now:

So, this is just a simple gain 6, but I couldn't find out how to calculate the resistor values involved when the shifting gets in place to make it work with negative input values. I was trying to use the following schematics as a reference, but I didn't get it to work on my project:

A few questions:

1 - Is rail to rail output required here?
2 - Where do I get the Ref Voltage for shifting? Why is it usually 1/2 Vout? I only want to use my +12V source supply.

I appreciate all help.

2. ### wayneh Expert

Sep 9, 2010
13,612
4,411
Just a question: How are you powering the LM35? It won't generate a negative voltage unless it is supplied a negative voltage. Maybe you could power your op-amp and ADC with the same supply. Since you aren't really amplifying the signal, maybe you don't even need an op-amp.

If your temperature never goes below ~1°C, you can forget about the negative voltage problem. I forget how close to 0°C you can get and still have an accurate output from the LM35.

Try switching R1 and R2 in your 2nd circuit. It looks to me like it ought to work. Did you build it or only simulate it?

Last edited: Aug 15, 2016
3. ### KeepItSimpleStupid Well-Known Member

Mar 4, 2014
2,068
359
Again, just a question.

Are you familiar with absolute and relative references? Some sensors, particularly automobiles use references of the supply voltage. Thus 50% is 50% of full scale happens to be 50% of whatever the supply happens to be at at the time. Nominally, the output may be aproximately 0 to 5V, but usually the bottom and top end are not 0 and not exactly 5V.

This happens with microprocessor interfacing as well. The ZERO in a lot of cases is 1/2 Vcc and thus changes when Vcc happens to be 5.0 or 5.1 volts. This means you don't have to have a real stable, temperature compensated reference.

4. ### marcelosouza Thread Starter New Member

Aug 12, 2016
3
0

It actually generates negative voltages. It is -550mV for -55ºC and +1500mV for 150ºC, linear scale. I am using the same +12V power supply for the LM35 and the op amp, but the circuit I have with me was bought for a 0-12 V output and I am trying to simulate one that has 0-2.4 V output before I get my hands dirty. I also would like to have the full temperature scale within this range.

I think since the scale on the input does not have 0V at its center the shifting of negative values becomes more complicated.

I didn't get "invert R1 and R2". Wouldn't it just change my gain? This second circuit is not my scenario exactly. I found it online for reference since it looks very similar to what I am trying to do. It looks to me the shifting is done by R3, R4 and Vref.

Last edited: Aug 16, 2016
5. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,649
1,595
No, it doesn't.

There are no power supply circuits and no energy storage elements within the LM35, and you need one or both of those to have an output voltage on pin 2 that is more negative than the potential on pin 3. The part may *try* to make a negative voltage, but it cannot. Page 1 of the datasheet shows that there must be an external resistor from pin 2 to a negative voltage in order for the output to swing below pin 3. Your schematic does not have this part.

Separate from that, the opamp circuit must have both gain and DC offset to achieve your goal. The schematic in post #1 has a non-inverting gain of 1.6 (not 6). In fact, what you need is a gain of 1.17. Hint - the overal circuit gain requirement is the total output voltage range divided by the *total* input voltage range.

If you add a negative voltage power rail to your circuit so the pull-down output resistor mentioned above has somewhere to go, then that negative voltage is available to create the offset you need. This is done by replacing R2 in your schematic with two resistors, one to GND and one to the negative rail. The two resistors form a voltage divider with a center point of -0.55 V. The value of these two resistors in parallel is used for the shunt leg of the gain equation.

ak

OBW0549 likes this.
6. ### OBW0549 Well-Known Member

Mar 2, 2015
1,866
1,527
AnalogKid is absolutely right: it DOES NOT generate negative voltages. The output will go down to negative voltages below 0 °C, but ONLY if you give it an assist by providing it with an external pulldown. By itself, without any pulldown, the output can only go down to to about 15-20 mV above ground. Refer to the LM35 data sheet, at the diagram in the lower right-hand corner of the first page labeled "Full Range Centigrade Temperature Sensor."

7. ### marcelosouza Thread Starter New Member

Aug 12, 2016
3
0
Sorry. You guys are right about the -Vs for Full Range Centigrade Temperature described on page 1 of the datasheet.

But then, on page 16, there's this:

The circuit I bought ready has the LM35 and a LM358 op amp and it uses a single +12V supply to read it's entire scale, negative and positive temperatures, as a 0-12V from the op amp output, so I know there must be a way. It's impossible to follow the schematics from the PCB itself, so I am trying to guess what's going on by the reference numbers of the components in order to replicate this for my 0-2.4V output.

8. ### OBW0549 Well-Known Member

Mar 2, 2015
1,866
1,527
Yup, that's one way to get the job done using a single, positive supply: simply raise the (-) terminal of the LM35 above ground, and connect a load resistor from the LM35's output to ground to provide the pulldown current. If your device uses only a +12V supply yet indicates down to -55 °C, chances are this is how they did it.

The downside of this approach is that you now have to process a differential sensor signal rather than a simple, single-ended signal; however, with many modern A/D converters able to handle differential inputs anyway, this might not be a very big deal.

9. ### eetech00 Active Member

Jun 8, 2013
819
148
Hi

So....are you trying to scale the output of the circuit you bought from 0-12 to 0-2.4?
Or do you want to create a new circuit?

If new, you could shift the scale,then buffer with an opamp (+/-1.50 input, 3.0 out),
then perform math in the MC to give the correct value. So 0 degrees C = 1.5v

Last edited: Aug 16, 2016
10. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,649
1,595
The method in post #5 will work for the schematic in post #7.

Another downside of this circuit is that the Vf of added diodes has its own temperature coefficient. Its relative change in mV/degree is stable enough that some electronic temperature monitors (like the one built into a Pentium) use a diode as the temperature sensor. The problem is that its absolute value is not well controlled, so it can introduce an error equal to several degrees-C into a differential measurement.

ak

wayneh likes this.
11. ### wayneh Expert

Sep 9, 2010
13,612
4,411
A more precise way is to use a genuine voltage reference to split the 12V into a positive and negative range. In other words make a dual supply, except the LM35 doesn't require the high end to be regulated.