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.

Accuracy of lm35dz on pic16f877a

Status
Not open for further replies.

cjhaw

New Member
Hi,

I am building a circuit to measure temperature difference within 2 lm35dz by using pic16f877a.

I have a problem on lm35dz on the accuracy of adc of pic16f877a. It is realised that the accuracy of of lm35dz is 0.25 'C. After it is connected to adc of pic16f877a with 10 bits, the accuracy become 0.50 'C. So how can I do in order to achieve back the 0.25 'C of accuracy?

Thank you.
 
Hi,

I am building a circuit to measure temperature difference within 2 lm35dz by using pic16f877a.

I have a problem on lm35dz on the accuracy of adc of pic16f877a. It is realised that the accuracy of of lm35dz is 0.25 'C. After it is connected to adc of pic16f877a with 10 bits, the accuracy become 0.50 'C. So how can I do in order to achieve back the 0.25 'C of accuracy?

Thank you.

hi,
Over what range of temperatures do want to measure also do you just want the difference temperature of the two LM35's.??
 
hi,
Over what range of temperatures do want to measure also do you just want the difference temperature of the two LM35's.??

It is within 20 to 30 'C. Yah, only the temperature difference. I already get the difference within 2 lm35 with pic16f877a. But I need the accuracy of 0.25 'C (eg. 20.25 'C, 20.5 'C 20.75 'C and so on), but not accuracy of 0.5 'C (eg. 20.5 'C, 21 'C, 21.5 'C and so on). So how can I do? Thanks.
 
It is within 20 to 30 'C. Yah, only the temperature difference. I already get the difference within 2 lm35 with pic16f877a. But I need the accuracy of 0.25 'C (eg. 20.25 'C, 20.5 'C 20.75 'C and so on), but not accuracy of 0.5 'C (eg. 20.5 'C, 21 'C, 21.5 'C and so on). So how can I do? Thanks.

hi,
One way is to use a external OPA, say a CA3140.

The 0.2Voffset for 20C is removed and the span between 0.2V and 0.3V [30C] is amplified to give a 5V signal as opposed to a 0.1V signal.

Using the adc right justified for 10 bits gives 1023 counts for a 10degC change.

NOTE: the accuracy will not improve, but the resolution will

Do you follow OK.?
 
Last edited:
You may be able to calibrate thru software to get better accuracy. Each lm35 would have to be calibrated seperately. Then error world be due to drift or some change in external conditions. Usually this sort of approach can reduce error by about a factor of 10.
 
Hi, Eric, thanks for your reply,

According to your reply,
One way is to use a external OPA, say a CA3140.

The 0.2Voffset for 20C is removed and the span between 0.2V and 0.3V [30C] is amplified to give a 5V signal as opposed to a 0.1V signal.

"Sorry because in the Title, I should put the 'sensitivity', not 'accuracy'. I need the sensitivity of the lm35 to be 0.25 'C. So the 0.25 'C I meant is not an error or offset (eg. 20.25 'C meant it is the exact temperature). Really sorry for my misunderstanding on the term 'accuracy'. So, I think amplifying the value output of lm35 might not work for the 'sensitivity'. Is it?"

Using the adc right justified for 10 bits gives 1023 counts for a 10degC change.

"Due to my calculation,
V_ref=5 V
For 10 bits
total steps = 10^2 = 1024 steps
resolution = 5 [V]/ 1024 [steps] ~5 mV/steps

From lm35dz
step to 'C factor = 10 [mV/'C]/5 [mV/steps]=2 steps/'C

So, the sensitivity is 0.5 'C. Is it like this?"

I am hoping that I can improve the sensitivity from the 0.5 'C to 0.25 'C. After correction of my question, any suggestion for it?

Thank you very much.
 
Hi, Russ Hensel,
Sorry because in the Title, I should put the 'sensitivity', not 'accuracy'. I need the sensitivity of the lm35 to be 0.25 'C. So the 0.25 'C I meant is not an error or offset (eg. 20.25 'C meant it is the exact temperature). Really sorry for my misunderstanding on the term 'accuracy'. Do you have any advice? thank you.
 
Using the adc right justified for 10 bits gives 1023 counts for a 10degC change.

"Due to my calculation,
V_ref=5 V
For 10 bits
total steps = 10^2 = 1024 steps; this should read 1023 steps
resolution = 5 [V]/ 1024 [steps] ~5 mV/steps, so this becomes 4.88mV/step


I am hoping that I can improve the sensitivity from the 0.5 'C to 0.25 'C. After correction of my question, any suggestion for it?

You can improve the resolution of the displayed temperature to 0.25C [or 0.1Cdeg]

Thank you very much.

hi,
You say that you want to work over a range of 20C thru 30C, the LM35 will output a voltage of 0.2V and 0.3V at these limits, thats a range of 0.1V

If you input this 0.1V change into the PIC's adc directly you would see an adc count of:

[0.2v/5v] *1023 = 41 counts to [0.3/5v]*1023 =61 counts which is only a 20 count change.
So at best you could only display to 1.0Cdeg.

To give a bigger change count change you need to amplify the LM35 output by say by at least a factor of 4, this would then give an adc count of 80.
Which gives a resolution of 0.25Cdeg

If you wanted to display 0.1Cdeg resolution you would multiply the 0.1V range by 9.77 times
This would give [0.977v/5v]*1023 = 200 counts.

Do you follow.?
 
Last edited:
hi,
You say that you want to work over a range of 20C thru 30C, the LM35 will output a voltage of 0.2V and 0.3V at these limits, thats a range of 0.1V

If you input this 0.1V change into the PIC's adc directly you would see an adc count of:

[0.2v/5v] *1023 = 41 counts to [0.3/5v]*1023 =61 counts which is only a 20 count change.
So at best you could only display to 1.0Cdeg.

To give a bigger change count change you need to amplify the LM35 output by say by at least a factor of 4, this would then give an adc count of 80.
Which gives a resolution of 0.25Cdeg

If you wanted to display 0.1Cdeg resolution you would multiply the 0.1V range by 9.77 times
This would give [0.977v/5v]*1023 = 200 counts.

Do you follow.?

Hi eric,
Oic. I will try using the amplifier. An question will post here later. Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top