Hello, there. I am currently doing the Cytron PR11 Temperature Control using LM35. Unfortunately, the temperature display on the LCD are 5 degree Celsius. May I know whether the problems come from the programming itself?
Measure the output voltage of the LM35 with a voltmeter. It measures the temperature as 10mV per degree C so it's output should be 250mV for a room temperature of 25C, for example. If that voltage is ok, then you have a programming problem.
Your code is just displaying the ADC value! You need to convert it to a temperature. Assuming a 5V reference, try temp=result*5/1024 to get the temperature * 100.
Just change my coding to this one? while the rest remain the same? I had tried it, unfortunately my LCD display 0.1 degree Celsius at room temperature @@
unsigned short read_temp(void)
{
unsigned short temp; temp=result*5/1024;
return temp;