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.

1.024 Voltage Reference for LM35

Status
Not open for further replies.
Another ADC question.

The LM35 Temperature Sensor gives 10mV/degreeC.
I am going to use a PIC microcontroller so, If I was to use a 1.024v voltage reference, giving me resolution of .1 degreeC with a 10 bit ADC, would it work?

If so, does anyone know where I can get one of these **broken link removed**
 
Last edited:
There are a couple of problems with your idea.

The LM35 is only accurate to 1/4C.
The Pics minimum Vref is 3V.

Mike.
 
Well what i wanted to do was use a PIC for a temperature sensor project.

All I want to do is display the temperature on 3 7-segment displays,
But I want to take it to 1 decimal place...

eg. 25.3

any sugestions?

Do I have to get a 1.024 volt reference range between 3 and 5 volts, and then Amplify the lm35's output?
 
i dont know how you change the resolution of the lm35 with a voltage referance but if you can - most pics have built in Vref module
in mid range PICs the Vref ranges from 0.21v - 3.59v (using a 5v power source) as seen here :mid range voltage reference module
you also must buffer the Vref output
 
i dont know how you change the resolution of the lm35 with a voltage referance
Well as i understood, if you shrink the range of the voltage refference to 1.024v, the Analogue to digital conversion will increment every 1mV, as opose to a 5 volt reference will will increment will every 4.88mV change.
 
yeah, I haven't looked at building the project yet, but am getting around to it and wanted to ask another question.

anyway... about oversampling.....
I still wont be able to get .1 degree resolution by doing it that way...

quote from previous thread:
Yep, but there may not be a need to amplify it. Set the Vref for 2.048v resolution which will then be 2mV or 0.2'C resolution.

Then average 16 readings over a period of one mains cycle, so the few mV noise picked up by the mains is negated, BUT it also adds a +/- varying factor to the ADC volatge so when you average it you can get double the resoltuion with a fair degree of accuracy.

So you add 16 readings over a mains cycle, then divide the total by 8, (giving you double the resolution) so it is now at a resolution of 0.1'C.

Say my Analogue to Digital Conversion is 0000000010 (2) when the output of the LM35 is 29mV (because of the 2mV resolution), and I get this 16 times in a row because the temperature is stable and well as noise. Ideal circumstance here, just for 'what if' senario.
If I add the 16 readings, giving me 0000100000 (32) and divide by 8, i'm back with 0000000010 (2), which when converted will display .4'C (with 2mV resolution), when infact the temperature is closer to .3'C.

Am I missing something?

All I want to do is get .1 degree resolution.
 
anyway... about oversampling.....
I still wont be able to get .1 degree resolution by doing it that way...

...because of the 2mV resolution...
The 2mV resolution is the base resolution of the ADC (2.048V / 10bit = 2mV). The point of oversampling is to increase the effective # of bits of the ADC. So if you do the oversampling as described to get 11 bits, 2.048 / 11bit = 1mV. You can apply a greater oversampling ratio to get even more bits. There is normally a small amount of noise required in the sample for this to work.

Am I missing something?

All I want to do is get .1 degree resolution.
Yup. I'll have a look for an AN on oversampling for you.. EDIT: OK, have a look at:
https://www.electro-tech-online.com/custompdfs/2009/11/doc8003.pdf
https://www.electro-tech-online.com...20Resolution20Using20Oversampling2001152A.pdf

I think you'll find the first doc to be easier to follow than the second, so have a read of that one first.
 
Last edited:
Have you read the datasheet for the LM35 ? Direct quote from the first page "0.5 degree C gauranteeable (at +25 degrees C)" . If the sensor is only accurate to .5 degrees then it is pointless to try to get .1 degree of resolution.
 
Thanks dougy83
Application notes are handy.
Thanks for replying calmly to the seemingly endless rhetorical questions.

When i eventualy get my head around this and put it to practice, I promise to document all this, because i'm sure there are others who were, and who will be as confused as me at some point.
 
Have you read the datasheet for the LM35 ? Direct quote from the first page "0.5 degree C gauranteeable (at +25 degrees C)" . If the sensor is only accurate to .5 degrees then it is pointless to try to get .1 degree of resolution.

ok, say for example i find a temp.sensor that does almost gaurentee .1mV/'C, how do i get .1'C resolution.

for me, I think its become more of a curiosity to find out how to get .1mV resolution, than a need.
I'll be content with even numbers for a temperature now, but I still want to know how it would be done.
 
Last edited:
Have you read the datasheet for the LM35 ? Direct quote from the first page "0.5 degree C gauranteeable (at +25 degrees C)" . If the sensor is only accurate to .5 degrees then it is pointless to try to get .1 degree of resolution.
I don't think it's pointless. The sensor doesn't move in steps of 0.5 degrees, so a higher resolution will give more accurate delta measurements & higher accuracy; e.g. with 0.5 degree ADC resolution the error can be up to 1 degree out.

Application notes are handy.
I think you'll find the atmel one to be very nicely done (even if the writer is confused about dividing/shifting), please read it, it's worth it. You could probably even give the microchip AN a miss.
 
ok, say for example i find a temp.sensor that does almost gaurentee .1mV/'C, how do i get .1'C resolution.
If you get a 0.1'C accurate thermometer, then you're laughing. You could also use it to calibrate your LM35 circuit at a few temperature points to allow a similar accuracy with the LM35 (e.g. using piecewise linear or polynomial interpolation).
 
I don't think it's pointless. The sensor doesn't move in steps of 0.5 degrees, so a higher resolution will give more accurate delta measurements & higher accuracy; e.g. with 0.5 degree ADC resolution the error can be up to 1 degree out.
...

I agree with that. Even though the sensor itself might not have perfect accuracy to the 0.1'C it is still very nice on the display.

For example, if the reading can be seen going up and down through 32.5'C to 32.8'C as the thermostat cycles that is useful information, much better than a display that just says 32'C.

As for thermometers accurate to 0.1'C, no problem. Talk to your pharmacist, they can order mercury-glass lab thermometers that come with calibration certificate, you can get 0-60'C 0-100'C and 0-125'C etc. They are not that expensive.

Just take a bit of time to convince him you're NOT setting up a meth lab, they can be a bit suspicious of people ordering lab equipment if they don't know you. ;)
 
For example, if the reading can be seen going up and down through 32.5'C to 32.8'C as the thermostat cycles that is useful information, much better than a display that just says 32'C.
that's what I meant to say, I just couldn't get it out lol
 
Resolution is useful without accuracy. Accuracy is a measures against absolute temperature, while resolution works against relative temperature. e.g. You might not know that it's exactly 25 deg C, but you do know that it is .1 deg C warmer than it was since the last sample.

Why don't you just get a LM75A and not worry about the PIC ADC at all? You'll get 0.125 deg C resolution.

EDIT: Sorry, that was explained well enough before. I didn't really need to restate it. LM75 suggestion still remains, though.
 
Last edited:
Maybe I should have made myself a little clearer. I did not mean that you would only display the whole number part of the temperature, I only meant that it would be pointless to try to get .1 degree of resolution when the sensor is only accurate to to .5 degrees. At the stated accuracy you will likely have a relatively stable reading on your display with regards to the decimal portion of the number. If you increase your resolution to greater than your accuracy then you might get a varying display every time you read the sensor even though the actual temperature did not change. A person will never be able to tell the difference between 20.1 and 20.8 degrees.
 
Maybe I should have made myself a little clearer. I did not mean that you would only display the whole number part of the temperature, I only meant that it would be pointless to try to get .1 degree of resolution when the sensor is only accurate to to .5 degrees. At the stated accuracy you will likely have a relatively stable reading on your display with regards to the decimal portion of the number. If you increase your resolution to greater than your accuracy then you might get a varying display every time you read the sensor even though the actual temperature did not change. A person will never be able to tell the difference between 20.1 and 20.8 degrees.
That's not what the accuracy spec means. It doesn't just report any value within it's accuracy spec from sample to sample. The accuracy is how close it is to the actual temperature without external correction due to variance in the manufacturing process and the design of the part itself. They do their own calibration on each chip, but that's the accuracy that they guarantee. If the actual temperature stays the same, the reported value will be the same down to it's finest reported resolution. If you took the specific chip you were working with and used a higher accuracy instrument to measure it against, you could create a correction table that would increase the accuracy of the LM35.

I agree that show the temp to .1 degree doesn't seem very useful, but it might be nice to see temperature drift.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top