LM35 with PIC question

Status
Not open for further replies.

jenifer85

New Member
Hi.

I am trying to do a system that can read temperature.
Im using a LM35(temperature sensor) to detect the temperature. The output of the LM35 give me a voltage corresponding to the temperature detected. For example at 25C I get 250mv.
Now im connecting this output to an analog input from a pic( im using 16f877A). Im trying to write a code in C programming with MPLAB, im doing a read_adc...but the pic doesn't seem to detect the voltage.. It always detect 255..

Maybe i need an amp op? Or maybe the problem is in my code?

I need help! thanks alot!

Jen
 
The problem is most likely with your code. When you post your code, make sure you surround it with the code tags. (Use the # button in the Advanced editing/posting window)
To get the best resolution from your temperature sensor, you'll need to use an OpAmp to scale the output of the LM35.
 
For a 0.5C resolution you don't need an opamp.

*Setup AD module
*Read ADC (wait until Go/Done clears)
*Read AdresL & AdresH & make it to decimal digits
*Show on the display
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…