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.

LM35 Testing

Status
Not open for further replies.
The 150* in display mean 0x96 hex value in register.
The logic is not clear 150*degree 1.5V
1*c 10mV , 1.5V =150*c
 
I'm going to ask you again!! One line question and answers are about as good as a chocolate fireguard!!

The 150* in display mean 0x96 hex value in register.
The logic is not clear 150*degree 1.5V
1*c 10mV , 1.5V =150*c

What isn't clear here? You are correct... 1.5v is 1500mV... 250mV is 25°C... 10mV is 1°C..
150 is 0x96..... 25 is 0x19
 
The logic is not clear to me 10mv =1*C
so, adc*=500;
adc=adc/1024;
if not multiply by 500 it shows 000;
if i change 500 to 5000 then it become 3 digit more accurate temperature.
what is the 500; doing logic not clear
 
You are reading mV...

10mV---> ADC---> 2 bits ( not very resolute )
2 * 5 / 1024 = 9.7mV or 0.0097 ..

20mV --> ADC--> 4
4 * 5 / 1024 = 19.5mV or 0.0195 ..

BUT!!!! were not using floating point.... so I used 500 to shift the decimal place twice!!

2 * 500 / 1024 = 000.97 <--- Ooh look!!!!! not quite 1 degree ( Datasheet said this!! )

2 * 5000 / 1024 = 0009.7 <--- Ooh look!!!!! Too much..
 
Ok the 1 degree will 9.7 mV
so uC will convert it to display how?
??? What have we been talking about for the last 50 posts....The equation IS to display .... the answer of the equation will be 001 at 10mV.... the answer will be 010 at 100mV and 150 at 1500mV.. 1 degree, 10 degree and 150 degree...
 
1 degree C is NOT 9.7 mV ( I think Ian may be suggesting using this as an approximation to make the maths simpler as you seem to have great difficulty with maths.)
So a real temperature of 20 Deg. C would read as 20.62 degrees
If you READ THE DATA SHEET you will find the 1 degree C is 10 mV
Multiply the raw output value by 5000/1024 (This give the result in mV) Ian has already told you this.
I will leave you to try to work out the next step .

Les.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top