Maker Pro
Maker Pro

LM34 to A/D

C

CptDondo

Jan 1, 1970
0
OK, I've got a basic problem. I've got an LM34D (32 - 212 deg F) temp
sensor <http://www.national.com/ds/LM/LM34.pdf> and I need to connect it
to a 0-10V A/D.

To make things more interesting, I am only looking for a relatively
narrow range - say from 50 deg. F to 120 deg. F.

I've got 12 bits of A/D, which, in theory, gives me lots of resolution,
but the LN34 is only good to about a degree. It outputs 10 mV/degree.

The way I read the LM34 spec, the range I am interested in is about
500mV to 1.2V, so I figure I need to amplify that by, say, 8 to get good
use of my A/D accuracy.

I'm mostly a software guy, although once in a while I can solder
something without serious injury.

I've been told I need an op-amp to make the above work, but I have no
idea how to get an op-amp to work in the above scenario.

Could someone please clue me in? Thanks,

--Yan
 
J

John Larkin

Jan 1, 1970
0
OK, I've got a basic problem. I've got an LM34D (32 - 212 deg F) temp
sensor <http://www.national.com/ds/LM/LM34.pdf> and I need to connect it
to a 0-10V A/D.

To make things more interesting, I am only looking for a relatively
narrow range - say from 50 deg. F to 120 deg. F.

I've got 12 bits of A/D, which, in theory, gives me lots of resolution,
but the LN34 is only good to about a degree. It outputs 10 mV/degree.

The way I read the LM34 spec, the range I am interested in is about
500mV to 1.2V, so I figure I need to amplify that by, say, 8 to get good
use of my A/D accuracy.

I'm mostly a software guy, although once in a while I can solder
something without serious injury.

I've been told I need an op-amp to make the above work, but I have no
idea how to get an op-amp to work in the above scenario.

Could someone please clue me in? Thanks,

--Yan

Why not use an LM71, digital serial SPI temp sensor? By the time you
buy an LM34, and an opamp, and a couple of precision resistors, the
LM71 starts to look like a bargain, and a number of analog gotchas
disappear.

John
 
C

CptDondo

Jan 1, 1970
0
John said:
Why not use an LM71, digital serial SPI temp sensor? By the time you
buy an LM34, and an opamp, and a couple of precision resistors, the
LM71 starts to look like a bargain, and a number of analog gotchas
disappear.

I have only 1 SPI bus, non-selectable. (I'm out of GPIO; I'm already
muxing and doing double duty....) I need at least 2 sensors,
preferrably 3. I have 5 A/D channels.... So it's more of a do with
what I have rather than do the best thing...
 
J

Joerg

Jan 1, 1970
0
John said:
Why not use an LM71, digital serial SPI temp sensor? By the time you
buy an LM34, and an opamp, and a couple of precision resistors, the
LM71 starts to look like a bargain, and a number of analog gotchas
disappear.

Pure luxury, at least in my field. We have to make do with diodes and
thermistors. If we were extra good, we get to enjoy a reference chip
alongside. As long as it doesn't cost more than 10c, that is.
 
J

John Larkin

Jan 1, 1970
0
I have only 1 SPI bus, non-selectable. (I'm out of GPIO; I'm already
muxing and doing double duty....) I need at least 2 sensors,
preferrably 3. I have 5 A/D channels.... So it's more of a do with
what I have rather than do the best thing...


OK, do this:

http://s2.supload.com/free/LM34_amp.JPG/view/


Gain is 1 + (15K/2K) = 8.5, and the resistors need to be 1% or better
to keep up the accuracy.

Don't run the LM34 from more than +5... they misbehave if you do.

Any decent "single supply" or "rail/rail input" opamp should work.

The output RC keeps ADC mux spikes from freaking out the opamp, and
reduces adc noise as well.

It's prudent to oversample and average to reduce residual noise.

John
 
J

John Larkin

Jan 1, 1970
0
Pure luxury, at least in my field. We have to make do with diodes and
thermistors. If we were extra good, we get to enjoy a reference chip
alongside. As long as it doesn't cost more than 10c, that is.

Hell, I buy gain-of-four amplifiers for $190 a pop, and single
flip-flops for $32.

John
 
J

Joerg

Jan 1, 1970
0
John said:
Hell, I buy gain-of-four amplifiers for $190 a pop, and single
flip-flops for $32.

$190? That's 30 six-packs of Porter. Toirrty of 'em!

(when they are on sale)

Sometimes it's amazing how little is inside "lab grade" amps. A few
BJTs, some 0603 resistors, a milled case. Then it's all marked up by a
few thousand percent. Just like us their mfgs only cook with water, they
just use bigger pots.
 
J

Joerg

Jan 1, 1970
0
Spehro said:
Don't forget to multiply by 10:1 or 20:1 for the rad-hard versions..

Or by 30 if it contains tubes, says "Super High Fidelity" on there and
comes with a guitar input.
 
S

Spehro Pefhany

Jan 1, 1970
0
Hell, I buy gain-of-four amplifiers for $190 a pop, and single
flip-flops for $32.

John

Don't forget to multiply by 10:1 or 20:1 for the rad-hard versions..


Best regards,
Spehro Pefhany
 
J

John Larkin

Jan 1, 1970
0
Don't forget to multiply by 10:1 or 20:1 for the rad-hard versions..


Best regards,
Spehro Pefhany

I wonder what's the most expensive IC you can buy. I've heard that
some high-end FPGA's, not even rad-hard, run close to $10K.

John
 
A

Anthony Fremont

Jan 1, 1970
0
John said:
OK, do this:

http://s2.supload.com/free/LM34_amp.JPG/view/


Gain is 1 + (15K/2K) = 8.5, and the resistors need to be 1% or better
to keep up the accuracy.

Don't run the LM34 from more than +5... they misbehave if you do.

Any decent "single supply" or "rail/rail input" opamp should work.

The output RC keeps ADC mux spikes from freaking out the opamp, and
reduces adc noise as well.

It's prudent to oversample and average to reduce residual noise.

So, does that op-amp have a charge pump built in? ;-)
 
F

Fred Bloggs

Jan 1, 1970
0
John said:
OK, do this:

http://s2.supload.com/free/LM34_amp.JPG/view/


Gain is 1 + (15K/2K) = 8.5, and the resistors need to be 1% or better
to keep up the accuracy.

Don't run the LM34 from more than +5... they misbehave if you do.

Any decent "single supply" or "rail/rail input" opamp should work.

The output RC keeps ADC mux spikes from freaking out the opamp, and
reduces adc noise as well.

It's prudent to oversample and average to reduce residual noise.

John

It's going to be a trick getting 10V out of that circuit, and you have
no offset, wasting 40% of the range.
 
J

John Larkin

Jan 1, 1970
0
So, does that op-amp have a charge pump built in? ;-)

Oh, yeah, run the opamp from whatever higher supply you have, if you
need to swing higher.

John
 
J

John Larkin

Jan 1, 1970
0
It's going to be a trick getting 10V out of that circuit, and you have
no offset, wasting 40% of the range.

Yup, the opamp needs a higher supply if the adc needs more swing. But
since the LM34 is only good to +-1 deg F, there's not a lot of
advantage to a gain above a few, and, actually, not any real advantage
of gain at all. The ADC lsb is 2 mV, and the 1 deg F error corresponds
to 5 LSBs.

Actually, unless you want to spring for 0.1% resistors, the gain stage
will probably make accuracy worse.

If the LM34 is connected directly to the ADC, inserting an R-C lowpass
is still a good idea. ADC mux's commonly kick out spikes, and the LM34
series has a weak pulldown and lots of quirks.

John
 
J

John Larkin

Jan 1, 1970
0
$190? That's 30 six-packs of Porter. Toirrty of 'em!

(when they are on sale)

Sometimes it's amazing how little is inside "lab grade" amps. A few
BJTs, some 0603 resistors, a milled case. Then it's all marked up by a
few thousand percent. Just like us their mfgs only cook with water, they
just use bigger pots.

The $190 amp is a tiny IC, not a box.

http://www.hittite.com/product_info/product_specs/amplifiers/hmc465.pdf

We use four of them in one of our products.


John
 
G

Genome

Jan 1, 1970
0
OK, I've got a basic problem. I've got an LM34D (32 - 212 deg F) temp
sensor <http://www.national.com/ds/LM/LM34.pdf> and I need to connect it
to a 0-10V A/D.

To make things more interesting, I am only looking for a relatively
narrow range - say from 50 deg. F to 120 deg. F.

I've got 12 bits of A/D, which, in theory, gives me lots of resolution,
but the LN34 is only good to about a degree. It outputs 10 mV/degree.

The way I read the LM34 spec, the range I am interested in is about
500mV to 1.2V, so I figure I need to amplify that by, say, 8 to get good
use of my A/D accuracy.

I'm mostly a software guy, although once in a while I can solder
something without serious injury.

I've been told I need an op-amp to make the above work, but I have no
idea how to get an op-amp to work in the above scenario.

Could someone please clue me in? Thanks,

--Yan

Well, there you go then. LM34 is only good to 1 degree, does 10mV per
degree, your A/D is 10/2^12 = 2.4mV.... plug it in and rock your
shiftyware..

Seriously, accuracy and resolution and other stuff are relative
things. If you only want the answer within +/-1.24 degrees (barp) or
less then don't be bovverred.

If you want more then you will be calibrating. Shiver.


DNA
 
S

Spehro Pefhany

Jan 1, 1970
0
I wonder what's the most expensive IC you can buy. I've heard that
some high-end FPGA's, not even rad-hard, run close to $10K.

John


The most expensive FPGA Digikey lists is $4,177.00 (6 million gates
and 684 I/O). OTOH, the Fairchild CCD595 is reputed to cost around
100K (81 megapixels).

I guess the most expensive IC is one that has a lot of masks and
doesn't work properly.


Best regards,
Spehro Pefhany
 
F

Fred Bloggs

Jan 1, 1970
0
John said:
Yup, the opamp needs a higher supply if the adc needs more swing. But
since the LM34 is only good to +-1 deg F, there's not a lot of
advantage to a gain above a few, and, actually, not any real advantage
of gain at all. The ADC lsb is 2 mV, and the 1 deg F error corresponds
to 5 LSBs.

Actually, unless you want to spring for 0.1% resistors, the gain stage
will probably make accuracy worse.

If the LM34 is connected directly to the ADC, inserting an R-C lowpass
is still a good idea. ADC mux's commonly kick out spikes, and the LM34
series has a weak pulldown and lots of quirks.

The gain makes the difference between induced noise on the board
amounting to several degrees or a fraction of a degree. The input range
of interest is 50-120 oF or 0.7V so a gain to full range of the ADC is
approximately x14. This means the ADC will see 140mV/oF versus 10mV/oF,
making reasonable amounts of onboard noise equivalent to a fraction of a
degree versus several whole degrees.
 
G

Gary Peek

Jan 1, 1970
0
John said:
Don't run the LM34 from more than +5... they misbehave if you do.

John, just for everyone's benefit, what have you seen the LM34
do at higher voltages?

(BTW, all that care that must be taken regarding this device's
sensitivity to capacitive loading and the fact that you need
to included a negative supply or other roundabout methods for
reading temperatures below zero has made me try the LM50 if
I need an analog type sensor.)

Gary Peek, Industrologic, Inc.
 
J

John Larkin

Jan 1, 1970
0
The gain makes the difference between induced noise on the board
amounting to several degrees or a fraction of a degree. The input range
of interest is 50-120 oF or 0.7V so a gain to full range of the ADC is
approximately x14. This means the ADC will see 140mV/oF versus 10mV/oF,
making reasonable amounts of onboard noise equivalent to a fraction of a
degree versus several whole degrees.

But you could oversample and average. Temperature changes slowly, and
code is cheap.

John
 
Top