ADC Basics (LM35)

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

ADC Basics (LM35)

Postby Danial » Thu Oct 24, 2013 10:28 am

Hi,

i am using an LM35 for sensing temperature. I have a problem to display the right temperature on the LCD. I am using an 8 bit ADC. Therefore, the range is from 0-255 for ADC value. For ADC value of 1, it is equivalent to 0.01953V. If my ADC value is currently 103, then 103 x 0.01953V = 2.0116V. For the LM35, it states that it can read -55C up to 150C and for 10mV/C. If my voltage is 2.0116V, how to display the temperature? Anyone out there that can enlighten me? Thank you very much in advance.
Danial
Greenhorn
 
Posts: 2
Joined: Thu Oct 24, 2013 10:16 am

Re: ADC Basics (LM35)

Postby robosang » Thu Oct 24, 2013 11:58 am

robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: ADC Basics (LM35)

Postby Danial » Thu Oct 24, 2013 12:11 pm

Thanks Robosang.

the programs that you referred is to take the average of 10 adc readings and then just divide by 2. I'll try it.
Danial
Greenhorn
 
Posts: 2
Joined: Thu Oct 24, 2013 10:16 am

Re: ADC Basics (LM35)

Postby ober » Thu Oct 24, 2013 5:50 pm

LM35 datasheet stated 0mV + 10mV/degree Celsius. at 0 degree C, the voltage is 0V.

The tutorial that robosang shared is base on 10-bit ADC, you are using 8-bit, you cannot apply that formula.

Find out what is the relationship between degree Celsius and Voltage, replace the Voltage with ADC you get.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 24 guests