# Computation of temperature using Temp Sensor Lm35 with LPC1768

Discussion created by lpcware on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by newbie on Sat Aug 17 02:24:34 MST 2013
Hi,

I have connected a LM35 to ADC channel 1 of LPC1768. getting a value of 306(adc reading).

Vref =5V
Step size = 5V/4096=1.22mV
to calculate the output voltage.
= 306*1.22mV= 373.32mV

LM35 sensor gives an output of 10mV for every 1 degree centigrade.
so the measured temperature is = 373.32/10= 37 degree centigrade

Referred Mazidi's AVR Microcontroller and Embedded Systems book,
The digital output from ADC is calculated by the below formula
if Vout is calculated with the above formula then o/p voltage is
Vout = 306/1.22=250.819mV

Voltage to temperature conversion = 250.819mV/10mV = 25.08 degree centigrade.

Unable to figure out what is right. Kindly help. Sorry for this silly question.

Also connected an LDR to ADC channel 0 of LPC1768. Calculated the measured output voltage