Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Opamp help

Status
Not open for further replies.

Mosaic

Well-Known Member
Hi:
Can anyone with a simulator help develop the LM258 Opamp circuit to convert an LM335 absolute temp sensor output to celsius?

The LM335 outputs 10mV per deg Kelvin.. so it's output is about 2.73V at 0 Deg C.

I'd like the opamp to do 2 things.
1) Common mode reject 2.43 V, so at 0V out the actual temp is -30 DegC.
2) Amplify the signal so that the lm258 outputs perhaps 3.5V at 57.5 degC.

That means the 87.5 deg C swing requires 40mV per deg C, or a 4X signal amplification.

With an 8 bit ADC referenced at 5V ...this translates to 2 bits per deg C accuracy.
I want to use the 8 MSB of a 10bit ADC to reduce error due to elec. noise as the opamp has to drive the signal about 5' thru an automotive harness.

The opamp will output via a 1K then via the harness wire then to the PIC ADC via another 1K, to protect against a harness short to 12V.



3.5V is the full voltage swing of the lm258 at single rail +5Vdd.
 
Hi there,


If you build a non inverting amplifier with a fixed offset you should be able to get that kind of response. The amplifier would be built as follows (see attachment):
R1 connects from the inverting input to ground.
R2 connects from the output to the inverting input (feedback resistor).
R3 connects from the +5v supply to the inverting input (offset resistor).
The input connects to the non inverting input.
That's a simple configuration.

The defining equation for this circuit is:
Vo=((Vi*R2+Vi*R1)*R3+(Vi-5)*R1*R2)/(R1*R3)
where
Vo is the output voltage,
Vi is the input voltage,
5 is the reference voltage as discussed above.


Solving that equation for the two inputs of 2.700v and 2.710v and two outputs of 0.000v and 0.040v we get two equations in R2/R3 and R2/R1 from which we can find R2 and R3 after hand picking a value for R1. The general solutions are:

R2=R1*21/25, and
R3=R2*25/54 or R3=R1*7/18

Lets say we choose R1=10k, that makes R2=8.4k and R3=3.888k. These values give us 0v out at 2.700v in and for every additional 10mv we get 40mv additional output which means we get 40mv per deg C out.

Note however there will most likely be some input offset voltage which means the values of R2 and R3 may have to be adjusted slightly.
For example, for an op amp input offset of -1mv the values would change slightly to R2=8.408k and R3=3.894k, which may or may not affect the application significantly. For an input offset of +1mv the values would chance slightly to R2=8.392k and R3=3.884k, which again may or may not be significant to the application.
Note also that the +5v reference must be stable. It is possible to use a separate reference at a lower voltage if there will be a problem here, which would of course require modification of the two resistor values. For example, using a 4v reference would require changing that 5 in the defining equation to 4 and then rework the resistor values for R2 and R3.
 

Attachments

  • TemperatureMeasureAmp-01.gif
    TemperatureMeasureAmp-01.gif
    3.7 KB · Views: 219
Last edited:
hi Mosaic,
This is a clip from a circuit I use for the LM355 temperature sensor, using a MCP6002 rail2rail OPA.

It could be modified to suit your tempr range.
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    6.7 KB · Views: 447
Thx guys,. Eric, If I can live with the 0-3.5V range , would the lm258 work as a replacement for the mcp6002?
 
Thx guys,. Eric, If I can live with the 0-3.5V range , would the lm258 work as a replacement for the mcp6002?

hi,
You should get within 5V -1.5V [3.5v] for the maximum output swing on the LM258 and within a few tens of mV of zero volts.
 
I managed to do a sim in ISIS. The resistor values are from what I have on hand. The sim indicates reasonable accuracy of about 0.5 deg C or .02V, which is ok for me.

I used a differential amp followed by a 4x non inverter amp. This allowed me to use readily available standard resistors. Althought the sim caters for -30 C, I observe that accuracy starts to degrade under -20 C. Prob due to the limitations of the 1st opamp approaching it's 'floor voltage'.

Do u think I should include a 0.1uf cermic cap across the Pwrsupply to decouple any noise added from the harness? The pwr supply is very low impedance.
 

Attachments

  • lm335_-30 to 60 Celsius.png
    lm335_-30 to 60 Celsius.png
    101.8 KB · Views: 276
Last edited:
I managed to do a sim in ISIS. The resistor values are from what I have on hand. The sim indicates reasonable accuracy of about 0.5 deg C or .02V, which is ok for me.

I used a differential amp followed by a 4x non inverter amp. This allowed me to use readily available standard resistors. Althought the sim caters for -30 C, I observe that accuracy starts to degrade under -20 C. Prob due to the limitations of the 1st opamp approaching it's 'floor voltage'.

Do u think I should include a 0.1uf cermic cap across the Pwrsupply to decouple any noise added from the harness? The pwr supply is very low impedance.

Hi,
I would always add a 100nF across the power rails.
BTW: look at the d/s for the LM335, the non calibrated accuracy can be very poor, add the 10k from the adjust for improved accuracy.
 

Attachments

  • 000esp01.gif
    000esp01.gif
    9.9 KB · Views: 204
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top