Interfacing a parallel port to read temperature

S

Thread Starter

suresh

i am doing project on interfacing adc to parallel port for reading temperature using lm35.

i connected lm35 to adc0804 and it is interfaced to parallel port. lm35 givig 0.295v and it given to adc and i gave 5v as vcc and 2.5 as reference voltage to adc .adc is in free running mode of operation.
i got code in net it giving output 255 and 208 inbetween reading.. here it is the code.

//TEMPERATURE MEASUREMENT

//The most commonly available LM35 is LM35DZ measures temperature from 0 to 100
//degree.Output is 10mV* degree in Celsius. That is if the temperature is 29 degree then
//Vout=.29V. Therefore we require a least count of .01V for measurement of
//temperature with 1degree difference.
//So we should select a proper Vref least count=Vref/255 , gives Vref=2.55. So we have
//to apply 2.55/2(Vref/2) to the pin9.

//Code:

#include<dos.h>
#include"bparlib.c"
#define ChipSelect Clear_ControlPort_bit(0) // to clear RD' and CS'
int Read_adc(void);
void main()
{
int b;
b=Read_adc();
printf(" %d \n",b);


getch();
}

int Read_adc(void)
{
ChipSelect; //to select the chip, enabled
delay(1);
Clear_ControlPort_bit(1);
delay(1);
Set_ControlPort_bit(1);
delay(1);
return(Read_DataPort());
}
can one please help .........
how measure temperature....
reply me very urgent need..
my mail id is [email protected]

thank u in advance
 
Top