Microcontroller › PIC › help interfacing two lm35 pic16f877a and lcd › sir, my problem is that I am
sir,
my problem is that I am getting 2.5V and -2.5V in portD instead of 5V and 0V respectively. Is it possible to measure 5V and 0V in that port? Or do I need revision of my code? by the way I am using external reference voltage(+VREF and -VREF). There is a condition:
FOR FIRST SENSOR:
Ch0 = ADCRead(0); //Gets reading from channel 0
if (Ch0 < Temp35){ //if the temperature is less than 35 degrees RD0 gives 5V if not 0V.
RD0_bit = 1; //Turn on
}
else{
RD0_bit = 0; //Turn off
if(Ch0 > Temp50){ // if the temperature is greater than 50 degrees RD1 gives 5V otherwise 0V
RD1_bit = 1; //Turn on
}
else{
RD1_bit = 0; //Turn off
}
FOR SECOND SENSOR:
Ch1 = ADCRead(1); //Gets reading from channel 0
if (Ch1 < Temp38){ //whenever second sensor reaches less than 38 degrees RD2 gives 5V and if not 0 V
RD2_bit = 1; //Turn on
}
else{
RD2_bit = 0; //Turn off
}
if(Ch1 > Temp55){ //if temperature is greater than 55 degrees RD3 gives 5v otherwise 0V
RD3_bit = 1; //Turn on
}
else{
RD3_bit = 0; //Turn off
}
Likewise the circuit is connected to LCD which displays the amount of temperature,.
hope you understand me..
thank you and more power.