LM35 with PIC adc

Status
Not open for further replies.
Yep and it's imposible to achieve such resolution in real life (and you are very limited by sensors resolution anyways...)
 
it looks like the LM35 is accurate to a tenth of a milli Volt
thats 0.0001V

so 2.5*1 /1024 =0.0024 V at its lowest reading .. and

2.5*1023/1024=2.4975 V
2.5*1024/1024 = 2.5000V at its maximum
question??
where are you going to be doing these calculations ...ie how are you going to be displaying the data ??
because if you are going to to be making decisions based on the temp reading .. there is no need to calculate the value returned , in volts..
 
williB said:
it looks like the LM35 is accurate to a tenth of a milli Volt
thats 0.0001V

I didn't see that in the datasheet?.

What I did see was it's guaranteed accurate within 0.5 of a degree centigrade at 25 degrees centigrade. Linearity is guaranteed to be no worse than 1.5% over it's full range.

A 10 bit A2D in a PIC is going to be fine for this, no problem at all, in theory exceeding the spec of the LM35 - and certainly exceeding the capability of calibrating it that accurately?.
 
i agree that the 10 bits available are plenty for the job..
why would they state the output as 10.0 mV and not 10mV if it wasnt accurate to a tenth of a milli volt.
 

Attachments

  • lm35_148.jpg
    12.7 KB · Views: 1,026
williB said:
i agree that the 10 bits available are plenty for the job..
why would they state the output as 10.0 mV and not 10mV if it wasnt accurate to a tenth of a milli volt.

They could state it as 10.00000000mV, but it still means EXACTLY the same as 10mV - try reading the datasheet for details of the device!.
 
whoa cowboy.. calm down..lol
i did read the data sheet, but that was all i could find on the accuracyof the voltage output...
 
Does anyone have a good algorithm for displaying a decimal number on an LCD?
For example, if I want to display 25.1.
I'm thinking of multiplying it by 10 first, then dividing the number by 100 to get 2, then divide the remainder by 10 to get 5, then divide the remainder again to get 1.
Any better suggestions?
 

If you have a decimal number then you just display it, by converting each digit to ASCII. If the number is hexadecimal you need a HEX to Decimal conversion routine. If you check various of my tutorials (including the analogue one), I provide just such a routine that's fast and easy to use - I didn't write it, I found it on the PICList. As for the decimal point, you just insert it where it needs to go!.
 

This is the code I normally use to display a single byte number. The number to be displayed is in the W register.

Code:
WriteDec    clrf    Decimal100
Count100s   incf    Decimal100,F
            addlw   100h-100;   -100
            btfsc   STATUS, C
            GoTo    Count100s
            addlw   100
            clrf    Decimal10
Count10s    incf    Decimal10,F
            addlw   0f6h;       -10
            btfsc   STATUS, C
            GoTo    Count10s
            movwf   Units
            movfw   Decimal100
            addlw   2fh
            Call    WriteData
            movfw   Decimal10
            addlw   2fh
            Call    WriteData
            movfw   Units
            addlw   30h+0ah
WriteData
; here should be the code to write a 
; character to the LCD

HTH

Mike.
 
Jay.slovak said:
And I would replace R1 with serial combination of trimer and resistor, so it can be fine tuned.

Dumb question:
If I were to replace R1 with a trimer and resistor as you suggested, how would I connect the 3 leads of the trimer? :?
 
lol no problem :lol:
Try this
 

Attachments

  • trimer_resistor.gif
    1.9 KB · Views: 324
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…