Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

wanna convert values into centigrade

Status
Not open for further replies.

cool.man

Full Member level 6
Joined
May 29, 2008
Messages
323
Helped
42
Reputation
84
Reaction score
29
Trophy points
1,308
Location
Earth
Activity points
3,307
step size input adc 10bit

Hi everyone;
i am reading analog values from lm35(temprature IC) in pica6f877a.
I wanna know that how i convert these values in centigrade.
Range of lm35 is from 2 degrees centigrade to 150 degree centigrade and i want to read n display temprature from 2 degree to 50 degree centigrade and
also i am using 10-bit A/D converter.
plz tell me
Thanks
 

celcius to millivolt converter

hi
i think
voltage=ADC value *step size

stepsize for 10 bit=5/1024 if 5v if reference
Shakeel
 

lm35 wrong values

thanx shakeel
but i am still confuse. i am not getting ur point properly.
if i use the formula as u say
ADC value=(v input (lm35 output) * 1024)/vref
i am using this like that
Code:
float adc1,adc2;

while(1)
{
 set_adc_channel(2);
 adc1=read_adc();
 adc2=(adc1*1024)/5;
 printf("adc value is %f\r\n",adc2);
}
but i am not getting the right value.
Is there any other way to read n convert values into centigrade
 

maximum centigrade value

You've to fit the input signal to the ADC converter dynamic, in other word, your PIC ADC can give 10 bit word from a signal between 0 and 5V then at first you need to fit the analog signal with the input range of the used ADC.
If you like to measure a temperature value between 2 °C to 150 °C look at the LM35 specification, if you're using the first schematic (Figure 1 into the datasheet) you have 10 mV every °C then 2 °C -> 20mV, for 150 °C you should be able to read 1.5 V.
Now you've a problem, for a 10 bit DAC you've a minimum of 5/1024=4.88 mV then you should be able to read 20 mV and correct understand it, but the maximum value of your interval is only 1.5 V, less than the maximum allowable of 5V then your reading will be compress because 20 mV is approx equal to a digital value 4 and 1.5 V is equal to 307.2 a total range of about 303 digital value regard a total available of 1024. You need to fit the analog signal to the 0 - 5 V range, or better from 0.5 to 4 V, to do this use operational amplifier and then make the needed calculation into the microcontroller.

As other way you can use inexpensive digital termometer LM70 with SPI interface, precision is 0.25 °C for a temperature range between -55 to +150 °C, with this device no need to use ADC or other amplifier, simply read the digital value and make your scaling calculation inside the microcontroller.

**broken link removed**
**broken link removed**

Hope it help

Bye
Powermos
 

convert millivolt to celcius

Thanks TekUT
if i simply do this then would it be right or wrong or display right or wrong values
my code is as follows
void main()
{
int16 value,value1;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
while(1)
{
set_adc_channel(2);
delay_ms(500);
value=read_adc();
value1=5*value*100/1023;
printf("%f\r\n",(float)value1);
}
}

one more thing it takes 10mV for 1 step.can i reduce it to 5mV.
 

how to convert lm35 to centigrade?

Could you post the resulted data after conversion and the related voltage value at the input of the ADC pin?

Bye
Powermos
 

lm70 calculation

the resulted data is when my room temp is 27

27.34
27.34
27.83
27.83
.
.
.
.



when i increase the temp by means of place soldering iron near lm35 the temprature raises.

the voltage at the input of adc is approx274.78mV
is this calculation is right.
i think it is wrong but i am not sure
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top